mirror of
https://github.com/openharmony/developtools_ace-js2bundle.git
synced 2026-07-18 16:54:27 -04:00
@@ -143,28 +143,7 @@ let config = {
|
||||
poll: false,
|
||||
ignored: /node_modules/
|
||||
},
|
||||
optimization: {
|
||||
splitChunks: {
|
||||
chunks(chunk) {
|
||||
return !/^\.\/workers\//.test(chunk.name) && !/^\.\/TestAbility/.test(chunk.name);
|
||||
},
|
||||
minSize: 0,
|
||||
cacheGroups: {
|
||||
vendors: {
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
priority: -10,
|
||||
name: "vendors",
|
||||
},
|
||||
commons: {
|
||||
test: /\.js|css|hml$/,
|
||||
name: 'commons',
|
||||
priority: -20,
|
||||
minChunks: 2,
|
||||
reuseExistingChunk: true
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
devtoolModuleFilenameTemplate: 'webpack:///[absolute-resource-path]',
|
||||
@@ -298,7 +277,32 @@ module.exports = (env) => {
|
||||
if (process.env.DEVICE_LEVEL === 'card') {
|
||||
config.module = cardModule
|
||||
config.plugins.push(new AfterEmitPlugin())
|
||||
if (env.isPreview !== "true") {
|
||||
notPreview(env)
|
||||
}
|
||||
} else {
|
||||
config.optimization = {
|
||||
splitChunks: {
|
||||
chunks(chunk) {
|
||||
return !/^\.\/workers\//.test(chunk.name) && !/^\.\/TestAbility/.test(chunk.name);
|
||||
},
|
||||
minSize: 0,
|
||||
cacheGroups: {
|
||||
vendors: {
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
priority: -10,
|
||||
name: "vendors",
|
||||
},
|
||||
commons: {
|
||||
test: /\.js|css|hml$/,
|
||||
name: 'commons',
|
||||
priority: -20,
|
||||
minChunks: 2,
|
||||
reuseExistingChunk: true
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
if (env.isPreview !== "true") {
|
||||
notPreview(env)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user