kn-cli 1.0.129 → 1.0.131
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/build/webpack.config.js +6 -2
- package/package.json +1 -1
package/build/webpack.config.js
CHANGED
|
@@ -51,6 +51,7 @@ const appVersion= CLI_CONFIG?.version ?? '';
|
|
|
51
51
|
const devServer=CLI_CONFIG?.devServer??{};
|
|
52
52
|
const prject_name = CLI_CONFIG?.name??'';
|
|
53
53
|
const sourceMapLocal = CLI_CONFIG?.sourcemap?.local??false;//是否将soucemap改为本地
|
|
54
|
+
const resolveModules=CLI_CONFIG?.resolve?.modules??[];
|
|
54
55
|
|
|
55
56
|
warn(`=====================env-webpack=========================`);
|
|
56
57
|
warn(`devMode:${devMode}`);
|
|
@@ -293,7 +294,8 @@ if(CLI_CONFIG.rules){
|
|
|
293
294
|
rules.push({
|
|
294
295
|
test: /\.[m]?js[x]?$/,
|
|
295
296
|
include: new RegExp(`(${JS_LIST})`),
|
|
296
|
-
use: LOADER_JS
|
|
297
|
+
use: LOADER_JS,
|
|
298
|
+
type: 'javascript/auto',
|
|
297
299
|
},)
|
|
298
300
|
}
|
|
299
301
|
}
|
|
@@ -523,9 +525,11 @@ const config={
|
|
|
523
525
|
output: output,
|
|
524
526
|
resolve: {
|
|
525
527
|
modules: [
|
|
526
|
-
|
|
528
|
+
...resolveModules,
|
|
529
|
+
// 1. 强制只找当前项目根目录下的 node_modules,不往上爬
|
|
527
530
|
path.resolve(dirname,'node_modules'),
|
|
528
531
|
path.resolve(webpackPath, 'node_modules'),
|
|
532
|
+
// 'node_modules'
|
|
529
533
|
],
|
|
530
534
|
extensions: ['.jsx', '.js', '.json','.mjs'],
|
|
531
535
|
alias: {
|