|
|
@ -2,6 +2,7 @@ const { join } = require('path'); |
|
|
|
const { rspack } = require('@rspack/core'); |
|
|
|
const { rspack } = require('@rspack/core'); |
|
|
|
const NodeExternals = require('webpack-node-externals'); |
|
|
|
const NodeExternals = require('webpack-node-externals'); |
|
|
|
const { RunScriptWebpackPlugin } = require('run-script-webpack-plugin'); |
|
|
|
const { RunScriptWebpackPlugin } = require('run-script-webpack-plugin'); |
|
|
|
|
|
|
|
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); |
|
|
|
|
|
|
|
|
|
|
|
const baseDevConfig = { |
|
|
|
const baseDevConfig = { |
|
|
|
mode: 'development', |
|
|
|
mode: 'development', |
|
|
@ -21,6 +22,7 @@ const baseDevConfig = { |
|
|
|
exclude: /node_modules/, |
|
|
|
exclude: /node_modules/, |
|
|
|
loader: 'builtin:swc-loader', |
|
|
|
loader: 'builtin:swc-loader', |
|
|
|
options: { |
|
|
|
options: { |
|
|
|
|
|
|
|
sourceMap: true, |
|
|
|
jsc: { |
|
|
|
jsc: { |
|
|
|
parser: { |
|
|
|
parser: { |
|
|
|
syntax: 'typescript', |
|
|
|
syntax: 'typescript', |
|
|
@ -33,9 +35,16 @@ const baseDevConfig = { |
|
|
|
decoratorMetadata: true, |
|
|
|
decoratorMetadata: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
target: 'es2017', |
|
|
|
target: 'es2017', |
|
|
|
|
|
|
|
loose: true, |
|
|
|
|
|
|
|
externalHelpers: false, |
|
|
|
|
|
|
|
keepClassNames: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
module: { |
|
|
|
module: { |
|
|
|
type: 'commonjs', |
|
|
|
type: 'commonjs', |
|
|
|
|
|
|
|
strict: false, |
|
|
|
|
|
|
|
strictMode: true, |
|
|
|
|
|
|
|
lazy: false, |
|
|
|
|
|
|
|
noInterop: false, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
@ -76,6 +85,12 @@ const baseDevConfig = { |
|
|
|
name: 'main.js', |
|
|
|
name: 'main.js', |
|
|
|
autoRestart: true, |
|
|
|
autoRestart: true, |
|
|
|
}), |
|
|
|
}), |
|
|
|
|
|
|
|
new ForkTsCheckerWebpackPlugin({ |
|
|
|
|
|
|
|
typescript: { |
|
|
|
|
|
|
|
context: join(__dirname), |
|
|
|
|
|
|
|
configFile: join('tsconfig.ee-cloud.json'), |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}), |
|
|
|
], |
|
|
|
], |
|
|
|
output: { |
|
|
|
output: { |
|
|
|
path: join(__dirname, 'dist'), |
|
|
|
path: join(__dirname, 'dist'), |
|
|
|