mirror of
https://github.com/openharmony/developtools_ace-js2bundle.git
synced 2026-07-22 06:35:52 -04:00
@@ -143,28 +143,7 @@ let config = {
|
|||||||
poll: false,
|
poll: false,
|
||||||
ignored: /node_modules/
|
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: {
|
output: {
|
||||||
filename: '[name].js',
|
filename: '[name].js',
|
||||||
devtoolModuleFilenameTemplate: 'webpack:///[absolute-resource-path]',
|
devtoolModuleFilenameTemplate: 'webpack:///[absolute-resource-path]',
|
||||||
@@ -298,7 +277,32 @@ module.exports = (env) => {
|
|||||||
if (process.env.DEVICE_LEVEL === 'card') {
|
if (process.env.DEVICE_LEVEL === 'card') {
|
||||||
config.module = cardModule
|
config.module = cardModule
|
||||||
config.plugins.push(new AfterEmitPlugin())
|
config.plugins.push(new AfterEmitPlugin())
|
||||||
|
if (env.isPreview !== "true") {
|
||||||
|
notPreview(env)
|
||||||
|
}
|
||||||
} else {
|
} 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") {
|
if (env.isPreview !== "true") {
|
||||||
notPreview(env)
|
notPreview(env)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user