neo-cmp-cli 1.7.0 → 1.7.2

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/README.md CHANGED
@@ -474,8 +474,8 @@ module.exports = {
474
474
  ```javascript
475
475
  module.exports = {
476
476
  neoCommonModule: {
477
- // neoExports: ['xxModule'], // 数组写法,可用于导出第三方依赖模块
478
- neoExports: { 'xxModule_A': path.resolve('./src/components/xxModule_A') }, // 对象写法,如果导出内容模块,需要使用绝对路径导出
477
+ // exports: ['xxModule'], // 数组写法,可用于导出第三方依赖模块
478
+ exports: { 'xxModule_A': path.resolve('./src/components/xxModule_A') }, // 对象写法,如果导出内容模块,需要使用绝对路径导出
479
479
  },
480
480
  }
481
481
  ```
@@ -485,7 +485,7 @@ module.exports = {
485
485
  module.exports = {
486
486
  neoCommonModule: {
487
487
  remoteDeps: ['neo-custom-cmpA'], // 远程自定义组件,表示当前自定义组件 B 会用到的自定义组件
488
- neoExternals: ['xxModule_A'], // 自定义组件中需要剔除的模块(远程自定义组件中分享出来的模块),仅支持数组写法,需要和 remoteDeps 配合使用
488
+ externals: ['xxModule_A'], // 自定义组件中需要剔除的模块(远程自定义组件中分享出来的模块),仅支持数组写法,需要和 remoteDeps 配合使用
489
489
  },
490
490
  }
491
491
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo-cmp-cli",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "前端脚手架:自定义组件开发工具,支持react 和 vue2.0技术栈。",
5
5
  "keywords": [
6
6
  "neo-cli",
@@ -41,12 +41,12 @@ module.exports = {
41
41
  // 用于添加 Neo 共享依赖模块的配置信息
42
42
  /*
43
43
  neoCommonModule: {
44
- // neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
45
- neoExports: { // 对象写法
44
+ // exports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
45
+ exports: { // 对象写法
46
46
  'xxModule': path.resolve('./src/components/xxModule'), // 导出 xx组件 或 xx模块
47
47
  },
48
- // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 neoExternals 配合使用
49
- // neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
48
+ // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 externals 配合使用
49
+ // externals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
50
50
  },
51
51
  */
52
52
  preview: {
@@ -161,92 +161,95 @@ yargs
161
161
  neoConfigInit('neo.config.js');
162
162
  }
163
163
  )
164
- .command(
165
- 'create project [options]',
166
- '创建自定义组件项目(含工程代码)',
167
- (yargs) => {
168
- yargs
169
- .reset()
170
- .usage(titleTip('Usage') + ': $0 preview [options]')
171
- .option('name', {
172
- alias: 'n',
173
- describe: '自定义组件项目名称'
174
- })
175
- .alias('h', 'help');
176
- },
177
- (argv) => {
178
- if (argv.name) {
179
- mainAction.createCmpProjectByTemplate(argv.name);
180
- } else {
181
- const questions = [
182
- {
183
- name: 'name',
184
- type: 'input',
185
- message: '请设置自定义组件项目名称:'
186
- }
187
- ];
188
-
189
- inquirer.prompt(questions).then((ans) => {
190
- // 验证项目名称是否合法
191
- const { isValid, errors } = validateProjectName(ans.name);
192
- if (!isValid) {
193
- console.error(errors.join('\n'));
194
- process.exit(1);
195
- }
196
-
197
- if (!ans.name) {
198
- console.error('自定义组件项目名称不能为空。');
199
- process.exit(1);
200
- } else {
201
- mainAction.createCmpProjectByTemplate(ans.name);
202
- }
203
- });
164
+ .command('create', '创建项目或者组件', (yargs) => {
165
+ return yargs
166
+ .command(
167
+ 'project [options]',
168
+ '创建自定义组件项目(含工程代码)',
169
+ (yargs) => {
170
+ yargs
171
+ .reset()
172
+ .usage(titleTip('Usage') + ': $0 project [options]')
173
+ .option('name', {
174
+ alias: 'n',
175
+ describe: '自定义组件项目名称'
176
+ })
177
+ .alias('h', 'help');
178
+ },
179
+ (argv) => {
180
+ if (argv.name) {
181
+ mainAction.createCmpProjectByTemplate(argv.name);
182
+ } else {
183
+ const questions = [
184
+ {
185
+ name: 'name',
186
+ type: 'input',
187
+ message: '请设置自定义组件项目名称:'
188
+ }
189
+ ];
190
+
191
+ inquirer.prompt(questions).then((ans) => {
192
+ // 验证项目名称是否合法
193
+ const { isValid, errors } = validateProjectName(ans.name);
194
+ if (!isValid) {
195
+ console.error(errors.join('\n'));
196
+ process.exit(1);
197
+ }
198
+
199
+ if (!ans.name) {
200
+ console.error('自定义组件项目名称不能为空。');
201
+ process.exit(1);
202
+ } else {
203
+ mainAction.createCmpProjectByTemplate(ans.name);
204
+ }
205
+ });
206
+ }
204
207
  }
205
- }
206
- )
207
- .command(
208
- 'create cmp [options]',
209
- '创建自定义组件',
210
- (yargs) => {
211
- yargs
212
- .reset()
213
- .usage(titleTip('Usage') + ': $0 preview [options]')
214
- .option('name', {
215
- alias: 'n',
216
- describe: '自定义组件名称'
217
- })
218
- .alias('h', 'help');
219
- },
220
- (argv) => {
221
- if (argv.name) {
222
- mainAction.createCmpByTemplate(argv.name);
223
- } else {
224
- const questions = [
225
- {
226
- name: 'name',
227
- type: 'input',
228
- message: '请设置自定义组件名称:'
229
- }
230
- ];
231
-
232
- inquirer.prompt(questions).then((ans) => {
233
- if (!ans.name) {
234
- console.error('自定义组件名称不能为空。');
235
- process.exit(1);
236
- } else {
237
- mainAction.createCmpByTemplate(ans.name);
238
- }
239
- });
208
+ )
209
+ .command(
210
+ 'cmp [options]',
211
+ '创建自定义组件',
212
+ (yargs) => {
213
+ yargs
214
+ .reset()
215
+ .usage(titleTip('Usage') + ': $0 cmp [options]')
216
+ .option('name', {
217
+ alias: 'n',
218
+ describe: '自定义组件名称'
219
+ })
220
+ .alias('h', 'help');
221
+ },
222
+ (argv) => {
223
+ if (argv.name) {
224
+ mainAction.createCmpByTemplate(argv.name);
225
+ } else {
226
+ const questions = [
227
+ {
228
+ name: 'name',
229
+ type: 'input',
230
+ message: '请设置自定义组件名称:'
231
+ }
232
+ ];
233
+
234
+ inquirer.prompt(questions).then((ans) => {
235
+ if (!ans.name) {
236
+ console.error('自定义组件名称不能为空。');
237
+ process.exit(1);
238
+ } else {
239
+ mainAction.createCmpByTemplate(ans.name);
240
+ }
241
+ });
242
+ }
240
243
  }
241
- }
242
- )
244
+ )
245
+ })
243
246
  .command(
244
247
  'pull cmp [options]',
245
248
  '拉取线上自定义组件',
246
249
  (yargs) => {
247
250
  yargs
248
251
  .reset()
249
- .usage(titleTip('Usage') + ': $0 preview [options]')
252
+ .usage(titleTip('Usage') + ': $0 pull cmp [options]')
250
253
  .option('name', {
251
254
  alias: 'n',
252
255
  describe: '自定义组件名称'
@@ -295,7 +298,7 @@ yargs
295
298
  (yargs) => {
296
299
  yargs
297
300
  .reset()
298
- .usage(titleTip('Usage') + ': $0 deleteCmp [options]')
301
+ .usage(titleTip('Usage') + ': $0 delete cmp [options]')
299
302
  .option('name', {
300
303
  alias: 'n',
301
304
  describe: '自定义组件名称'
@@ -484,7 +487,7 @@ yargs
484
487
  (yargs) => {
485
488
  yargs
486
489
  .reset()
487
- .usage(titleTip('Usage') + ': $0 pushCmp [options]')
490
+ .usage(titleTip('Usage') + ': $0 push cmp [options]')
488
491
  .option('name', {
489
492
  alias: 'n',
490
493
  describe: '自定义组件名称'
@@ -26,7 +26,7 @@ const getValue = (originValue, defaultValue) => {
26
26
 
27
27
  const neoCommonModule = curConfig.neoCommonModule || {};
28
28
  // 自定义组件 需要剔除的依赖模块
29
- const cmpNeoExternals = neoCommonModule.neoExternals || [];
29
+ const cmpNeoExternals = neoCommonModule.externals || [];
30
30
 
31
31
  /**
32
32
  * 添加 AddNeoRequirePlugin 到 webpack 配置
@@ -51,11 +51,11 @@ function addNeoRequirePlugin(webpackConfig, options = {}) {
51
51
  * @param {object} externalsConfig 现有的 externals 配置
52
52
  */
53
53
  function addNeoExternals(config, externalsConfig) {
54
- const neoExternals = getExternalsByNeoCommonModules(cmpNeoExternals);
54
+ const externals = getExternalsByNeoCommonModules(cmpNeoExternals);
55
55
  if (externalsConfig && _.isPlainObject(externalsConfig)) {
56
- config.externals = Object.assign(externalsConfig, neoExternals);
56
+ config.externals = Object.assign(externalsConfig, externals);
57
57
  } else {
58
- config.externals = neoExternals;
58
+ config.externals = externals;
59
59
  }
60
60
  }
61
61
 
@@ -24,19 +24,19 @@ const NeoCommonModules = {
24
24
 
25
25
  // 根据 Neo 共享出来的依赖模块,获取 externals 配置
26
26
  const getExternalsByNeoCommonModules = (cmpNeoExternals) => {
27
- const neoExternals = {};
27
+ const externals = {};
28
28
  Object.keys(NeoCommonModules).forEach(moduleName => {
29
- neoExternals[moduleName] = `commonjs ${moduleName}`;
29
+ externals[moduleName] = `commonjs ${moduleName}`;
30
30
  });
31
31
 
32
- // 如果自定义组件有共享的依赖模块,则合并到 neoExternals
32
+ // 如果自定义组件有共享的依赖模块,则合并到 externals
33
33
  if (cmpNeoExternals && cmpNeoExternals.length > 0) {
34
34
  cmpNeoExternals.forEach(moduleName => {
35
- neoExternals[moduleName] = `commonjs ${moduleName}`;
35
+ externals[moduleName] = `commonjs ${moduleName}`;
36
36
  });
37
37
  }
38
38
 
39
- return neoExternals;
39
+ return externals;
40
40
  };
41
41
 
42
42
  // 用于添加共享的依赖模块
@@ -41,12 +41,12 @@ module.exports = {
41
41
  // 用于添加 Neo 共享依赖模块和剔除模块
42
42
  /*
43
43
  neoCommonModule: {
44
- // neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
45
- neoExports: { // 对象写法
44
+ // exports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
45
+ exports: { // 对象写法
46
46
  'xxModule': path.resolve('./src/components/xxModule'), // 导出 xx组件 或 xx模块
47
47
  },
48
- // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 neoExternals 配合使用
49
- // neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块(仅支持数组写法)
48
+ // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 externals 配合使用
49
+ // externals: ['xxModule'], // 自定义组件中需要剔除的模块(仅支持数组写法)
50
50
  },
51
51
  */
52
52
  preview: {
@@ -48,7 +48,7 @@
48
48
  "@commitlint/config-conventional": "^9.1.1",
49
49
  "@types/react": "^16.9.11",
50
50
  "@types/react-dom": "^16.9.15",
51
- "neo-cmp-cli": "^1.7.0",
51
+ "neo-cmp-cli": "^1.7.2",
52
52
  "husky": "^4.2.5",
53
53
  "lint-staged": "^10.2.9",
54
54
  "prettier": "^2.0.5"
@@ -41,13 +41,13 @@ module.exports = {
41
41
  // 用于添加 Neo 共享依赖模块的配置信息
42
42
  /*
43
43
  neoCommonModule: {
44
- // neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
45
- neoExports: { // 对象写法
44
+ // exports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
45
+ exports: { // 对象写法
46
46
  'chart-widget': path.resolve('./src/components/chart-widget'), // 导出图表自定义组件
47
47
  'neo-register': 'neo-register', // 导出 Neo 注册模块
48
48
  },
49
- // remoteDeps: ['xxModule'], // 远程依赖组件,表示当前自定义组件会用到的远程依赖组件,需要和 neoExternals 配合使用
50
- // neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
49
+ // remoteDeps: ['xxModule'], // 远程依赖组件,表示当前自定义组件会用到的远程依赖组件,需要和 externals 配合使用
50
+ // externals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
51
51
  },
52
52
  */
53
53
  preview: {
@@ -41,14 +41,14 @@ module.exports = {
41
41
  // 用于添加 Neo 共享依赖模块的配置信息
42
42
  ///*
43
43
  neoCommonModule: {
44
- // neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
45
- neoExports: {
44
+ // exports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
45
+ exports: {
46
46
  // 对象写法
47
47
  'chart-widget': path.resolve('./src/components/chart-widget'), // 导出图表自定义组件
48
48
  'neo-register': 'neo-register', // 导出 Neo 注册模块
49
49
  },
50
- // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 neoExternals 配合使用
51
- // neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
50
+ // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 externals 配合使用
51
+ // externals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
52
52
  },
53
53
  //*/
54
54
  preview: {
@@ -48,7 +48,7 @@
48
48
  "@commitlint/config-conventional": "^9.1.1",
49
49
  "@types/react": "^16.9.11",
50
50
  "@types/react-dom": "^16.9.15",
51
- "neo-cmp-cli": "^1.7.0",
51
+ "neo-cmp-cli": "^1.7.2",
52
52
  "husky": "^4.2.5",
53
53
  "lint-staged": "^10.2.9",
54
54
  "prettier": "^2.0.5",
@@ -41,12 +41,12 @@ module.exports = {
41
41
  // 用于添加 Neo 共享依赖模块的配置信息
42
42
  /*
43
43
  neoCommonModule: {
44
- // neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
45
- neoExports: { // 对象写法
44
+ // exports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
45
+ exports: { // 对象写法
46
46
  'xxModule': path.resolve('./src/components/xxModule'), // 导出 xx组件 或 xx模块
47
47
  },
48
- // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 neoExternals 配合使用
49
- // neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
48
+ // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 externals 配合使用
49
+ // externals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
50
50
  },
51
51
  */
52
52
  preview: {
@@ -46,7 +46,7 @@
46
46
  "@commitlint/config-conventional": "^9.1.1",
47
47
  "@types/react": "^16.9.11",
48
48
  "@types/react-dom": "^16.9.15",
49
- "neo-cmp-cli": "^1.7.0",
49
+ "neo-cmp-cli": "^1.7.2",
50
50
  "husky": "^4.2.5",
51
51
  "lint-staged": "^10.2.9",
52
52
  "prettier": "^2.0.5"
@@ -49,12 +49,12 @@ module.exports = {
49
49
  // 用于添加 Neo 共享依赖模块的配置信息
50
50
  /*
51
51
  neoCommonModule: {
52
- // neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
53
- neoExports: { // 对象写法
52
+ // exports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
53
+ exports: { // 对象写法
54
54
  'xxModule': path.resolve('./src/components/xxModule'), // 导出 xx组件 或 xx模块
55
55
  },
56
- // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 neoExternals 配合使用
57
- // neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
56
+ // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 externals 配合使用
57
+ // externals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
58
58
  },
59
59
  */
60
60
  preview: {
@@ -52,7 +52,7 @@
52
52
  "@types/react": "^16.9.11",
53
53
  "@types/react-dom": "^16.9.15",
54
54
  "@types/axios": "^0.14.0",
55
- "neo-cmp-cli": "^1.7.0",
55
+ "neo-cmp-cli": "^1.7.2",
56
56
  "husky": "^4.2.5",
57
57
  "lint-staged": "^10.2.9",
58
58
  "prettier": "^2.0.5"
@@ -45,12 +45,12 @@ module.exports = {
45
45
  // 用于添加 Neo 共享依赖模块的配置信息
46
46
  /*
47
47
  neoCommonModule: {
48
- // neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
49
- neoExports: { // 对象写法
48
+ // exports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
49
+ exports: { // 对象写法
50
50
  'xxModule': path.resolve('./src/components/xxModule'), // 导出 xx组件 或 xx模块
51
51
  },
52
- // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 neoExternals 配合使用
53
- // neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
52
+ // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 externals 配合使用
53
+ // externals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
54
54
  },
55
55
  */
56
56
  preview: {
@@ -45,7 +45,7 @@
45
45
  "devDependencies": {
46
46
  "@commitlint/cli": "^8.3.5",
47
47
  "@commitlint/config-conventional": "^9.1.1",
48
- "neo-cmp-cli": "^1.7.0",
48
+ "neo-cmp-cli": "^1.7.2",
49
49
  "husky": "^4.2.5",
50
50
  "lint-staged": "^10.2.9",
51
51
  "prettier": "^2.0.5"
@@ -41,12 +41,12 @@ module.exports = {
41
41
  // 用于添加 Neo 共享依赖模块的配置信息
42
42
  /*
43
43
  neoCommonModule: {
44
- // neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
45
- neoExports: { // 对象写法
44
+ // exports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
45
+ exports: { // 对象写法
46
46
  'xxModule': path.resolve('./src/components/xxModule'), // 导出 xx组件 或 xx模块
47
47
  },
48
- // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 neoExternals 配合使用
49
- // neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
48
+ // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 externals 配合使用
49
+ // externals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
50
50
  },
51
51
  */
52
52
  preview: {
@@ -47,7 +47,7 @@
47
47
  "@commitlint/config-conventional": "^9.1.1",
48
48
  "@types/react": "^16.9.11",
49
49
  "@types/react-dom": "^16.9.15",
50
- "neo-cmp-cli": "^1.7.0",
50
+ "neo-cmp-cli": "^1.7.2",
51
51
  "husky": "^4.2.5",
52
52
  "lint-staged": "^10.2.9",
53
53
  "prettier": "^2.0.5"
@@ -50,12 +50,12 @@ module.exports = {
50
50
  // 用于添加 Neo 共享依赖模块的配置信息
51
51
  /*
52
52
  neoCommonModule: {
53
- // neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
54
- neoExports: { // 对象写法
53
+ // exports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
54
+ exports: { // 对象写法
55
55
  'xxModule': path.resolve('./src/components/xxModule'), // 导出 xx组件 或 xx模块
56
56
  },
57
- // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 neoExternals 配合使用
58
- // neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
57
+ // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 externals 配合使用
58
+ // externals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
59
59
  },
60
60
  */
61
61
  preview: {
@@ -45,7 +45,7 @@
45
45
  "devDependencies": {
46
46
  "@commitlint/cli": "^8.3.5",
47
47
  "@commitlint/config-conventional": "^9.1.1",
48
- "neo-cmp-cli": "^1.7.0",
48
+ "neo-cmp-cli": "^1.7.2",
49
49
  "husky": "^4.2.5",
50
50
  "lint-staged": "^10.2.9",
51
51
  "prettier": "^2.0.5",
@@ -9,9 +9,9 @@ const { isPlainObject } = require('lodash');
9
9
  * @returns 组件预览代码
10
10
  */
11
11
  const createCommonModulesCode = (neoCommonModule, cmpTypes) => {
12
- const { neoExports, remoteDeps } = neoCommonModule;
12
+ const { exports, remoteDeps } = neoCommonModule;
13
13
 
14
- if (!neoExports && !remoteDeps) {
14
+ if (!exports && !remoteDeps) {
15
15
  return '';
16
16
  }
17
17
  // 记录当前自定义组件共享出去的模块
@@ -19,18 +19,18 @@ const createCommonModulesCode = (neoCommonModule, cmpTypes) => {
19
19
  // 记录当前自定义组件需要的远程依赖组件
20
20
  const CustomCmpRemoteDeps = {};
21
21
 
22
- // 根据 neoExports 获取共享的依赖模块
23
- if (Array.isArray(neoExports) && neoExports.length > 0) {
24
- neoExports.forEach((module) => {
22
+ // 根据 exports 获取共享的依赖模块
23
+ if (Array.isArray(exports) && exports.length > 0) {
24
+ exports.forEach((module) => {
25
25
  CustomCmpCommonModules[module] = require(module);
26
26
  });
27
- } else if (isPlainObject(neoExports) && Object.keys(neoExports).length > 0) {
28
- Object.keys(neoExports).forEach((moduleId) => {
29
- CustomCmpCommonModules[moduleId] = `require('${neoExports[moduleId]}')`;
27
+ } else if (isPlainObject(exports) && Object.keys(exports).length > 0) {
28
+ Object.keys(exports).forEach((moduleId) => {
29
+ CustomCmpCommonModules[moduleId] = `require('${exports[moduleId]}')`;
30
30
  });
31
- } else if (neoExports) {
31
+ } else if (exports) {
32
32
  console.error(
33
- 'neoExports 格式不正确,请检查 neo.config.js 文件中的 neoCommonModule / neoExports 配置'
33
+ 'exports 格式不正确,请检查 neo.config.js 文件中的 neoCommonModule / exports 配置'
34
34
  );
35
35
  process.exit(1);
36
36
  }