@kne/modules-dev 2.1.20 → 2.1.22

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.
@@ -23,7 +23,18 @@ module.exports = {
23
23
  "assert": false,
24
24
  "querystring": false,
25
25
  "zlib": false,
26
- "fs": false
26
+ "fs": false,
27
+ // 支持 node: 协议的模块导入
28
+ "node:diagnostics_channel": false,
29
+ "node:http": false,
30
+ "node:https": false,
31
+ "node:stream": false,
32
+ "node:buffer": false,
33
+ "node:util": false,
34
+ "node:url": false,
35
+ "node:zlib": false,
36
+ "node:path": false,
37
+ "node:fs": false
27
38
  };
28
39
  return webpackConfig;
29
40
  }
@@ -1,5 +1,6 @@
1
1
  const path = require('path');
2
2
  const env = require('./env');
3
+ const {formatRemote} = require('./utils');
3
4
 
4
5
  module.exports = {
5
6
  overrideCracoConfig: ({cracoConfig, context, pluginOptions}) => {
@@ -38,6 +39,12 @@ module.exports = {
38
39
  });
39
40
  return cracoConfig;
40
41
  }, overrideWebpackConfig({webpackConfig, context}) {
42
+ const remoteName = formatRemote(`${env.componentsName}${env.openComponentsVersion ? `_${env.componentsVersion}` : ''}`);
43
+ webpackConfig.output = Object.assign({}, webpackConfig.output, {
44
+ uniqueName: remoteName,
45
+ chunkLoadingGlobal: `webpackChunk_${remoteName}`,
46
+ hotUpdateGlobal: `webpackHotUpdate_${remoteName}`
47
+ });
41
48
  webpackConfig.resolve.alias = Object.assign({}, webpackConfig.resolve.alias, {
42
49
  [`${env.moduleAliasName}/${context.packagePureName}/README.md`]: path.resolve(env.appDir, '../README.md')
43
50
  });
@@ -1,5 +1,6 @@
1
1
  const path = require("path");
2
2
  const env = require("./env");
3
+ const {formatRemote} = require('./utils');
3
4
 
4
5
  module.exports = {
5
6
  overrideCracoConfig: ({cracoConfig, pluginOptions}) => {
@@ -23,6 +24,12 @@ module.exports = {
23
24
  });
24
25
  return cracoConfig;
25
26
  }, overrideWebpackConfig({webpackConfig, context}) {
27
+ const remoteName = formatRemote(`${env.componentsName}${env.openComponentsVersion ? `_${env.componentsVersion}` : ''}`);
28
+ webpackConfig.output = Object.assign({}, webpackConfig.output, {
29
+ uniqueName: remoteName,
30
+ chunkLoadingGlobal: `webpackChunk_${remoteName}`,
31
+ hotUpdateGlobal: `webpackHotUpdate_${remoteName}`
32
+ });
26
33
  webpackConfig.resolve.alias = Object.assign({}, webpackConfig.resolve.alias, {
27
34
  [env.moduleAliasName]: env.moduleBaseDir
28
35
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kne/modules-dev",
3
- "version": "2.1.20",
3
+ "version": "2.1.22",
4
4
  "description": "用于辅助在项目内启动一个规范化组件开发的环境",
5
5
  "publishConfig": {
6
6
  "access": "public",