ko 5.3.4 → 5.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/actions/dev.js +6 -3
- package/lib/cli.js +1 -0
- package/lib/webpack/index.js +1 -1
- package/package.json +1 -1
package/lib/actions/dev.js
CHANGED
|
@@ -37,6 +37,11 @@ class Dev extends creator_1.WebpackCreator {
|
|
|
37
37
|
const conf = {
|
|
38
38
|
devtool: 'cheap-module-source-map',
|
|
39
39
|
plugins: [this.opts.analyzer && new BundleAnalyzerPlugin()].filter(Boolean),
|
|
40
|
+
optimization: {
|
|
41
|
+
splitChunks: {
|
|
42
|
+
chunks: 'all',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
40
45
|
};
|
|
41
46
|
return this.mergeConfig([this.baseConfig, conf]);
|
|
42
47
|
}
|
|
@@ -77,6 +82,7 @@ class Dev extends creator_1.WebpackCreator {
|
|
|
77
82
|
}
|
|
78
83
|
this.devServerConf.port = newPort;
|
|
79
84
|
webpack_dev_server_1.default.addDevServerEntrypoints(this.config(), this.devServerConf);
|
|
85
|
+
this.threadLoaderWarmUp();
|
|
80
86
|
const compiler = (0, webpack_1.default)(this.config());
|
|
81
87
|
const devServer = new webpack_dev_server_1.default(compiler, this.devServerConf);
|
|
82
88
|
let isFirstCompile = true;
|
|
@@ -91,9 +97,6 @@ class Dev extends creator_1.WebpackCreator {
|
|
|
91
97
|
}));
|
|
92
98
|
}
|
|
93
99
|
});
|
|
94
|
-
compiler.hooks.invalid.tap('invalid', () => {
|
|
95
|
-
console.log('Compiling...');
|
|
96
|
-
});
|
|
97
100
|
devServer.listen(this.devServerConf.port, this.devServerConf.host, err => {
|
|
98
101
|
if (err) {
|
|
99
102
|
console.error(err);
|
package/lib/cli.js
CHANGED
|
@@ -30,6 +30,7 @@ program
|
|
|
30
30
|
.option('-p, --port <port>', 'server start on which port', parseInt)
|
|
31
31
|
.option('--host <host>', 'specify a host to use')
|
|
32
32
|
.option('-t, --ts', 'support typescript')
|
|
33
|
+
.option('-h, --hash', 'output file name with hash')
|
|
33
34
|
.option('-a,--analyzer', 'support building analyzer')
|
|
34
35
|
.action((opts) => {
|
|
35
36
|
process.env.NODE_ENV = 'development';
|
package/lib/webpack/index.js
CHANGED
|
@@ -28,7 +28,7 @@ function getWebpackBaseConf(opts) {
|
|
|
28
28
|
entry: `src/index.${ts ? 'tsx' : 'js'}`,
|
|
29
29
|
output: {
|
|
30
30
|
path: config_1.default.defaultPaths.dist,
|
|
31
|
-
filename: hash ? '
|
|
31
|
+
filename: hash ? '[name].[contenthash].js' : '[name].js',
|
|
32
32
|
publicPath: '/',
|
|
33
33
|
},
|
|
34
34
|
module: {
|