Skip to content

Commit be26466

Browse files
committed
fix: webpack build assets should limit chunk
1 parent f203dba commit be26466

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

packages/toolkit/webpack/config.webview.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const path = require('path');
2+
const webpack = require('webpack');
23
const HtmlWebpackPlugin = require('html-webpack-plugin');
34
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
45

@@ -29,6 +30,9 @@ module.exports = (option = {}) => {
2930
template: option.template || path.join(__dirname, '../public/webview.html'),
3031
inject: false,
3132
}),
33+
new webpack.optimize.LimitChunkCountPlugin({
34+
maxChunks: 1,
35+
}),
3236
],
3337
};
3438
};

packages/toolkit/webpack/config.worker.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = () => {
99
return {
1010
entry: {
1111
[config.workerEntry]: require.resolve(
12-
'@opensumi/ide-extension/lib/hosted/worker.host-preload'
12+
'@opensumi/ide-extension/lib/hosted/worker.host-preload',
1313
),
1414
},
1515
output: {
@@ -36,6 +36,9 @@ module.exports = () => {
3636
new webpack.ProvidePlugin({
3737
...nodePolyfill.provider,
3838
}),
39+
new webpack.optimize.LimitChunkCountPlugin({
40+
maxChunks: 1,
41+
}),
3942
],
4043
stats: 'errors-only',
4144
};

scripts/utils/utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ exports.invoke = async (fn) => {
1010
};
1111

1212
exports.exec = async (command, options, silent = false) => {
13+
console.log(`[exec] ${command}`)
1314
try {
1415
return await execa.command(command, {
1516
stdio: 'inherit',

0 commit comments

Comments
 (0)