neo-cmp-cli 1.1.13 → 1.1.16
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/package.json +1 -1
- package/src/cmpUtils/createCommonModulesCode.js +6 -5
- package/src/neo/neoRequire.js +3 -3
- package/src/template/antd-custom-cmp-template/neo.config.js +3 -3
- package/src/template/antd-custom-cmp-template/package.json +1 -1
- package/src/template/echarts-custom-cmp-template/neo.config.js +2 -2
- package/src/template/echarts-custom-cmp-template/package.json +1 -1
- package/src/template/neo-custom-cmp-template/neo.config.js +2 -2
- package/src/template/neo-custom-cmp-template/package.json +1 -1
- package/src/template/react-custom-cmp-template/neo.config.js +2 -2
- package/src/template/react-custom-cmp-template/package.json +1 -1
- package/src/template/react-ts-custom-cmp-template/neo.config.js +2 -2
- package/src/template/react-ts-custom-cmp-template/package.json +1 -1
- package/src/template/vue2-custom-cmp-template/neo.config.js +5 -5
- package/src/template/vue2-custom-cmp-template/package.json +1 -1
package/package.json
CHANGED
|
@@ -28,7 +28,7 @@ const createCommonModulesCode = (neoCommonModule, cmpTypes) => {
|
|
|
28
28
|
Object.keys(neoExports).forEach((moduleId) => {
|
|
29
29
|
CustomCmpCommonModules[moduleId] = `require('${neoExports[moduleId]}')`;
|
|
30
30
|
});
|
|
31
|
-
} else {
|
|
31
|
+
} else if (neoExports) {
|
|
32
32
|
console.error(
|
|
33
33
|
'neoExports 格式不正确,请检查 neo.config.js 文件中的 neoCommonModule / neoExports 配置'
|
|
34
34
|
);
|
|
@@ -36,7 +36,7 @@ const createCommonModulesCode = (neoCommonModule, cmpTypes) => {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
// 根据 cmpTypes 和 remotes 设置远程组件信息
|
|
39
|
-
if (Array.isArray(
|
|
39
|
+
if (Array.isArray(remotes) && remotes.length > 0) {
|
|
40
40
|
cmpTypes.forEach((cmpType) => {
|
|
41
41
|
CustomCmpRemotes[cmpType] = remotes;
|
|
42
42
|
});
|
|
@@ -75,15 +75,16 @@ const addNeoRemotes = (remotes) => {
|
|
|
75
75
|
if (!window.__NeoCommonModules) {
|
|
76
76
|
window.__NeoCommonModules = {}
|
|
77
77
|
}
|
|
78
|
-
if (!window.__NeoCommonModules.
|
|
79
|
-
window.__NeoCommonModules.
|
|
78
|
+
if (!window.__NeoCommonModules.__neoRemotes) {
|
|
79
|
+
window.__NeoCommonModules.__neoRemotes = {}
|
|
80
80
|
}
|
|
81
81
|
if (isPlainObject(remotes)) {
|
|
82
|
-
window.__NeoCommonModules.
|
|
82
|
+
window.__NeoCommonModules.__neoRemotes = Object.assign(window.__NeoCommonModules.__neoRemotes, remotes)
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
addNeoCommonModules(CustomCmpCommonModules);
|
|
87
|
+
addNeoRemotes(CustomCmpRemotes);
|
|
87
88
|
`;
|
|
88
89
|
|
|
89
90
|
// 创建存放 cli 的临时目录
|
package/src/neo/neoRequire.js
CHANGED
|
@@ -52,11 +52,11 @@ const addNeoRemotes = (remotes) => {
|
|
|
52
52
|
if (!window.__NeoCommonModules) {
|
|
53
53
|
window.__NeoCommonModules = {}
|
|
54
54
|
}
|
|
55
|
-
if (!window.__NeoCommonModules.
|
|
56
|
-
window.__NeoCommonModules.
|
|
55
|
+
if (!window.__NeoCommonModules.__neoRemotes) {
|
|
56
|
+
window.__NeoCommonModules.__neoRemotes = {}
|
|
57
57
|
}
|
|
58
58
|
if (_.isPlainObject(remotes)) {
|
|
59
|
-
window.__NeoCommonModules.
|
|
59
|
+
window.__NeoCommonModules.__neoRemotes = Object.assign(window.__NeoCommonModules.__neoRemotes, remotes);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -32,8 +32,8 @@ module.exports = {
|
|
|
32
32
|
],
|
|
33
33
|
// createDeclaration: true, // 打包时是否创建ts声明文件
|
|
34
34
|
ignoreNodeModules: false, // 打包时是否忽略 node_modules
|
|
35
|
-
allowList: [], // ignoreNodeModules为true时生效
|
|
36
|
-
projectDir: ['src'],
|
|
35
|
+
// allowList: [], // ignoreNodeModules为true时生效
|
|
36
|
+
// projectDir: ['src'],
|
|
37
37
|
// template: resolve('./public/template.html'), // 自定义html模板
|
|
38
38
|
// plugins: [],
|
|
39
39
|
// babelPlugins: [],
|
|
@@ -43,7 +43,7 @@ module.exports = {
|
|
|
43
43
|
// neoExports: ['echarts'], // 自定义组件 共享出来的模块,支持数组和对象形式
|
|
44
44
|
// neoExports: {}, // 对象写法
|
|
45
45
|
// neoExternals: ['neo-register', 'chart-widget'], // 自定义组件 需要剔除的模块,仅支持数组写法
|
|
46
|
-
remotes: ['chart-widget'], // 远程组件,表示当前自定义组件会用到远程组件的导出模块,需要和 neoExternals 配合使用
|
|
46
|
+
// remotes: ['chart-widget'], // 远程组件,表示当前自定义组件会用到远程组件的导出模块,需要和 neoExternals 配合使用
|
|
47
47
|
},
|
|
48
48
|
preview: {
|
|
49
49
|
// 用于开启本地预览模式的相关配置信息
|
|
@@ -32,8 +32,8 @@ module.exports = {
|
|
|
32
32
|
],
|
|
33
33
|
// createDeclaration: true, // 打包时是否创建ts声明文件
|
|
34
34
|
ignoreNodeModules: false, // 打包时是否忽略 node_modules
|
|
35
|
-
allowList: [], // ignoreNodeModules为true时生效
|
|
36
|
-
projectDir: ['src'],
|
|
35
|
+
// allowList: [], // ignoreNodeModules为true时生效
|
|
36
|
+
// projectDir: ['src'],
|
|
37
37
|
// template: resolve('./public/template.html'), // 自定义html模板
|
|
38
38
|
// plugins: [],
|
|
39
39
|
// babelPlugins: [],
|
|
@@ -32,8 +32,8 @@ module.exports = {
|
|
|
32
32
|
],
|
|
33
33
|
// createDeclaration: true, // 打包时是否创建ts声明文件
|
|
34
34
|
ignoreNodeModules: false, // 打包时是否忽略 node_modules
|
|
35
|
-
allowList: [], // ignoreNodeModules为true时生效
|
|
36
|
-
projectDir: ['src'],
|
|
35
|
+
// allowList: [], // ignoreNodeModules为true时生效
|
|
36
|
+
// projectDir: ['src'],
|
|
37
37
|
// template: resolve('./public/template.html'), // 自定义html模板
|
|
38
38
|
// plugins: [],
|
|
39
39
|
// babelPlugins: [],
|
|
@@ -32,8 +32,8 @@ module.exports = {
|
|
|
32
32
|
],
|
|
33
33
|
// createDeclaration: true, // 打包时是否创建ts声明文件
|
|
34
34
|
ignoreNodeModules: false, // 打包时是否忽略 node_modules
|
|
35
|
-
allowList: [], // ignoreNodeModules 为 true 时生效
|
|
36
|
-
projectDir: ['src'],
|
|
35
|
+
// allowList: [], // ignoreNodeModules 为 true 时生效
|
|
36
|
+
// projectDir: ['src'],
|
|
37
37
|
// template: resolve('./public/template.html'), // 自定义html模板
|
|
38
38
|
// plugins: [], // 用于添加自定义 plugins
|
|
39
39
|
// cssLoaderUrlDir: 'antd',
|
|
@@ -32,8 +32,8 @@ module.exports = {
|
|
|
32
32
|
],
|
|
33
33
|
// createDeclaration: true, // 打包时是否创建ts声明文件
|
|
34
34
|
ignoreNodeModules: false, // 打包时是否忽略 node_modules
|
|
35
|
-
allowList: [], // ignoreNodeModules为true时生效
|
|
36
|
-
projectDir: ['src'],
|
|
35
|
+
// allowList: [], // ignoreNodeModules为true时生效
|
|
36
|
+
// projectDir: ['src'],
|
|
37
37
|
// template: resolve('./public/template.html'), // 自定义html模板
|
|
38
38
|
// plugins: [],
|
|
39
39
|
// babelPlugins: [],
|
|
@@ -41,11 +41,11 @@ module.exports = {
|
|
|
41
41
|
],
|
|
42
42
|
// createDeclaration: true, // 打包时是否创建ts声明文件
|
|
43
43
|
ignoreNodeModules: false, // 打包时是否忽略 node_modules
|
|
44
|
-
allowList: [], // ignoreNodeModules为true时生效
|
|
45
|
-
projectDir: ['src'],
|
|
46
|
-
plugins: [], // 自定义webpack插件
|
|
47
|
-
moduleRules: [], // 自定义webpack loader
|
|
48
|
-
babelPlugins: [],
|
|
44
|
+
// allowList: [], // ignoreNodeModules为true时生效
|
|
45
|
+
// projectDir: ['src'],
|
|
46
|
+
// plugins: [], // 自定义webpack插件
|
|
47
|
+
// moduleRules: [], // 自定义webpack loader
|
|
48
|
+
// babelPlugins: [],
|
|
49
49
|
},
|
|
50
50
|
preview: {
|
|
51
51
|
// 用于开启本地预览模式的相关配置信息
|