neo-cmp-cli 1.1.18 → 1.2.0
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 +0 -1
- package/src/neo/neoRequire.js +16 -1
- package/src/template/antd-custom-cmp-template/neo.config.js +7 -5
- package/src/template/antd-custom-cmp-template/package.json +2 -2
- package/src/template/echarts-custom-cmp-template/neo.config.js +6 -3
- package/src/template/echarts-custom-cmp-template/package.json +2 -2
- package/src/template/neo-custom-cmp-template/neo.config.js +12 -0
- package/src/template/neo-custom-cmp-template/package.json +1 -1
- package/src/template/react-custom-cmp-template/neo.config.js +12 -0
- package/src/template/react-custom-cmp-template/package.json +1 -1
- package/src/template/react-ts-custom-cmp-template/neo.config.js +12 -0
- package/src/template/react-ts-custom-cmp-template/package.json +1 -1
- package/src/template/vue2-custom-cmp-template/neo.config.js +12 -0
- package/src/template/vue2-custom-cmp-template/package.json +1 -1
package/package.json
CHANGED
|
@@ -60,7 +60,6 @@ import { isPlainObject } from 'lodash';
|
|
|
60
60
|
const CustomCmpCommonModules = ${customCmpCommonModulesCode};
|
|
61
61
|
const CustomCmpRemotes = ${JSON.stringify(CustomCmpRemotes)};
|
|
62
62
|
|
|
63
|
-
// 用于添加共享的依赖模块
|
|
64
63
|
// 用于添加共享的依赖模块
|
|
65
64
|
const addNeoCommonModules = (modules) => {
|
|
66
65
|
if (!window.__NeoCommonModules) {
|
package/src/neo/neoRequire.js
CHANGED
|
@@ -38,7 +38,22 @@ const getExternalsByNeoCommonModules = (cmpNeoExternals) => {
|
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
// 用于添加共享的依赖模块
|
|
41
|
-
addNeoCommonModules
|
|
41
|
+
const addNeoCommonModules = (modules) => {
|
|
42
|
+
if (!window.__NeoCommonModules) {
|
|
43
|
+
window.__NeoCommonModules = {}
|
|
44
|
+
}
|
|
45
|
+
if (isPlainObject(modules)) {
|
|
46
|
+
const moduleIds = Object.keys(modules);
|
|
47
|
+
moduleIds.forEach((moduleId) => {
|
|
48
|
+
const curModule = modules[moduleId];
|
|
49
|
+
if (window.__NeoCommonModules[moduleId]) {
|
|
50
|
+
window.__NeoCommonModules[moduleId] = Object.assign(window.__NeoCommonModules[moduleId], curModule);
|
|
51
|
+
} else {
|
|
52
|
+
window.__NeoCommonModules[moduleId] = curModule;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
42
57
|
|
|
43
58
|
// 用于添加自定义组件的远程组件
|
|
44
59
|
const addNeoRemotes = (remotes) => {
|
|
@@ -38,13 +38,15 @@ module.exports = {
|
|
|
38
38
|
// plugins: [],
|
|
39
39
|
// babelPlugins: [],
|
|
40
40
|
},
|
|
41
|
-
// Neo
|
|
41
|
+
// 用于添加 Neo 共享依赖模块和剔除模块
|
|
42
|
+
/*
|
|
42
43
|
neoCommonModule: {
|
|
43
|
-
// neoExports: ['
|
|
44
|
-
// neoExports: {}, // 对象写法
|
|
45
|
-
neoExternals: ['chart-widget'], //
|
|
46
|
-
remotes: ['chart-widget'], //
|
|
44
|
+
// neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
|
|
45
|
+
// neoExports: { 'xxModule': path.resolve('./src/components/xxModule') }, // 对象写法
|
|
46
|
+
neoExternals: ['chart-widget'], // 自定义组件中需要剔除的模块,仅支持数组写法
|
|
47
|
+
remotes: ['chart-widget'], // 远程组件,表示当前自定义组件会用到的远程组件,需要和 neoExternals 配合使用
|
|
47
48
|
},
|
|
49
|
+
*/
|
|
48
50
|
preview: {
|
|
49
51
|
// 用于开启本地预览模式的相关配置信息
|
|
50
52
|
/*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antd-custom-cmp-template",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "neo自定义组件模板(react&ts技术栈)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"自定义组件模板",
|
|
@@ -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.
|
|
50
|
+
"neo-cmp-cli": "^1.2.0",
|
|
51
51
|
"husky": "^4.2.5",
|
|
52
52
|
"lint-staged": "^10.2.9",
|
|
53
53
|
"prettier": "^2.0.5"
|
|
@@ -39,14 +39,17 @@ module.exports = {
|
|
|
39
39
|
// babelPlugins: [],
|
|
40
40
|
},
|
|
41
41
|
// 用于添加 Neo 共享依赖模块的配置信息
|
|
42
|
+
/*
|
|
42
43
|
neoCommonModule: {
|
|
43
|
-
// neoExports: [], // 自定义组件 共享出来的模块,支持数组和对象形式
|
|
44
|
-
neoExports: {
|
|
44
|
+
// neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
|
|
45
|
+
neoExports: { // 对象写法
|
|
45
46
|
'chart-widget': path.resolve('./src/components/chart-widget'), // 导出图表自定义组件
|
|
46
47
|
'neo-register': 'neo-register', // 导出 Neo 注册模块
|
|
47
48
|
},
|
|
48
|
-
// neoExternals: [], //
|
|
49
|
+
// neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
|
|
50
|
+
// remotes: ['xxModule'], // 远程组件,表示当前自定义组件会用到的远程组件,需要和 neoExternals 配合使用
|
|
49
51
|
},
|
|
52
|
+
*/
|
|
50
53
|
preview: {
|
|
51
54
|
// 用于开启本地预览模式的相关配置信息
|
|
52
55
|
/*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "echarts-custom-cmp-template",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "neo自定义组件模板(react&ts技术栈)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"自定义组件模板",
|
|
@@ -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.
|
|
50
|
+
"neo-cmp-cli": "^1.2.0",
|
|
51
51
|
"husky": "^4.2.5",
|
|
52
52
|
"lint-staged": "^10.2.9",
|
|
53
53
|
"prettier": "^2.0.5",
|
|
@@ -38,6 +38,18 @@ module.exports = {
|
|
|
38
38
|
// plugins: [],
|
|
39
39
|
// babelPlugins: [],
|
|
40
40
|
},
|
|
41
|
+
// 用于添加 Neo 共享依赖模块的配置信息
|
|
42
|
+
/*
|
|
43
|
+
neoCommonModule: {
|
|
44
|
+
// neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
|
|
45
|
+
neoExports: { // 对象写法
|
|
46
|
+
'chart-widget': path.resolve('./src/components/chart-widget'), // 导出图表自定义组件
|
|
47
|
+
'neo-register': 'neo-register', // 导出 Neo 注册模块
|
|
48
|
+
},
|
|
49
|
+
// neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
|
|
50
|
+
// remotes: ['xxModule'], // 远程组件,表示当前自定义组件会用到的远程组件,需要和 neoExternals 配合使用
|
|
51
|
+
},
|
|
52
|
+
*/
|
|
41
53
|
preview: {
|
|
42
54
|
// 用于开启本地预览模式的相关配置信息
|
|
43
55
|
/*
|
|
@@ -42,6 +42,18 @@ module.exports = {
|
|
|
42
42
|
},
|
|
43
43
|
moduleRules: [],
|
|
44
44
|
},
|
|
45
|
+
// 用于添加 Neo 共享依赖模块的配置信息
|
|
46
|
+
/*
|
|
47
|
+
neoCommonModule: {
|
|
48
|
+
// neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
|
|
49
|
+
neoExports: { // 对象写法
|
|
50
|
+
'chart-widget': path.resolve('./src/components/chart-widget'), // 导出图表自定义组件
|
|
51
|
+
'neo-register': 'neo-register', // 导出 Neo 注册模块
|
|
52
|
+
},
|
|
53
|
+
// neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
|
|
54
|
+
// remotes: ['xxModule'], // 远程组件,表示当前自定义组件会用到的远程组件,需要和 neoExternals 配合使用
|
|
55
|
+
},
|
|
56
|
+
*/
|
|
45
57
|
preview: {
|
|
46
58
|
// 用于开启本地预览模式的相关配置信息
|
|
47
59
|
/*
|
|
@@ -38,6 +38,18 @@ module.exports = {
|
|
|
38
38
|
// plugins: [],
|
|
39
39
|
// babelPlugins: [],
|
|
40
40
|
},
|
|
41
|
+
// 用于添加 Neo 共享依赖模块的配置信息
|
|
42
|
+
/*
|
|
43
|
+
neoCommonModule: {
|
|
44
|
+
// neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
|
|
45
|
+
neoExports: { // 对象写法
|
|
46
|
+
'chart-widget': path.resolve('./src/components/chart-widget'), // 导出图表自定义组件
|
|
47
|
+
'neo-register': 'neo-register', // 导出 Neo 注册模块
|
|
48
|
+
},
|
|
49
|
+
// neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
|
|
50
|
+
// remotes: ['xxModule'], // 远程组件,表示当前自定义组件会用到的远程组件,需要和 neoExternals 配合使用
|
|
51
|
+
},
|
|
52
|
+
*/
|
|
41
53
|
preview: {
|
|
42
54
|
// 用于开启本地预览模式的相关配置信息
|
|
43
55
|
/*
|
|
@@ -47,6 +47,18 @@ module.exports = {
|
|
|
47
47
|
// moduleRules: [], // 自定义webpack loader
|
|
48
48
|
// babelPlugins: [],
|
|
49
49
|
},
|
|
50
|
+
// 用于添加 Neo 共享依赖模块的配置信息
|
|
51
|
+
/*
|
|
52
|
+
neoCommonModule: {
|
|
53
|
+
// neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
|
|
54
|
+
neoExports: { // 对象写法
|
|
55
|
+
'chart-widget': path.resolve('./src/components/chart-widget'), // 导出图表自定义组件
|
|
56
|
+
'neo-register': 'neo-register', // 导出 Neo 注册模块
|
|
57
|
+
},
|
|
58
|
+
// neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
|
|
59
|
+
// remotes: ['xxModule'], // 远程组件,表示当前自定义组件会用到的远程组件,需要和 neoExternals 配合使用
|
|
60
|
+
},
|
|
61
|
+
*/
|
|
50
62
|
preview: {
|
|
51
63
|
// 用于开启本地预览模式的相关配置信息
|
|
52
64
|
/*
|