neo-cmp-cli 1.2.13 → 1.2.15

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo-cmp-cli",
3
- "version": "1.2.13",
3
+ "version": "1.2.15",
4
4
  "description": "前端脚手架:自定义组件开发工具,支持react 和 vue2.0技术栈。",
5
5
  "keywords": [
6
6
  "neo-cli",
@@ -110,9 +110,9 @@ module.exports = {
110
110
  curConfig.webpack.plugins &&
111
111
  Array.isArray(curConfig.webpack.plugins)
112
112
  ) {
113
- curConfig.webpack.plugins.push(new AddNeoRequirePlugin());
113
+ curConfig.webpack.plugins.push(new AddNeoRequirePlugin({verbose: true}));
114
114
  } else {
115
- curConfig.webpack.plugins = [new AddNeoRequirePlugin()];
115
+ curConfig.webpack.plugins = [new AddNeoRequirePlugin({verbose: true})];
116
116
  }
117
117
 
118
118
  // 添加 内置 Neo 的 externals 配置
@@ -230,9 +230,9 @@ module.exports = {
230
230
  curConfig.webpack.plugins &&
231
231
  Array.isArray(curConfig.webpack.plugins)
232
232
  ) {
233
- curConfig.webpack.plugins.push(new AddNeoRequirePlugin());
233
+ curConfig.webpack.plugins.push(new AddNeoRequirePlugin({verbose: true}));
234
234
  } else {
235
- curConfig.webpack.plugins = [new AddNeoRequirePlugin()];
235
+ curConfig.webpack.plugins = [new AddNeoRequirePlugin({verbose: true})];
236
236
  }
237
237
 
238
238
  // 添加 内置 Neo 的 externals 配置
@@ -5,6 +5,8 @@ const { ConcatSource } = require('webpack-sources');
5
5
  * 备注:用于实现和 Neo 平台共享依赖
6
6
  */
7
7
  class AddNeoRequirePlugin {
8
+ key = 'AddNeoRequirePlugin';
9
+
8
10
  constructor(options = {}) {
9
11
  this.options = {
10
12
  // 是否启用详细日志
@@ -17,9 +19,6 @@ class AddNeoRequirePlugin {
17
19
  skipPatterns: options.skipPatterns || [/\.map$/, /\.LICENSE\.txt$/, /\.html$/],
18
20
  ...options
19
21
  };
20
-
21
- // 记录已处理的文件,避免重复处理
22
- this.processedFiles = new Set();
23
22
  }
24
23
 
25
24
  /**
@@ -78,7 +77,7 @@ class AddNeoRequirePlugin {
78
77
  log(message, level = 'info') {
79
78
  if (this.options.verbose || level === 'error') {
80
79
  const prefix = `[AddNeoRequirePlugin]`;
81
- console[level](`${prefix} ${message}`);
80
+ console[level](`/n${prefix} ${message}`);
82
81
  }
83
82
  }
84
83
 
@@ -106,13 +105,6 @@ class AddNeoRequirePlugin {
106
105
  continue;
107
106
  }
108
107
 
109
- // 检查是否已经处理过
110
- if (this.processedFiles.has(filename)) {
111
- this.log(`跳过文件: ${filename} (已处理过)`);
112
- skippedCount++;
113
- continue;
114
- }
115
-
116
108
  // 获取文件内容
117
109
  const source = asset.source();
118
110
  const content = typeof source === 'string' ? source : source.toString();
@@ -133,7 +125,6 @@ class AddNeoRequirePlugin {
133
125
 
134
126
  // 执行注入
135
127
  this.injectNeoRequire(compilation, filename, content);
136
- this.processedFiles.add(filename);
137
128
  processedCount++;
138
129
 
139
130
  this.log(`成功处理文件: ${filename}`);
@@ -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.2.13",
50
+ "neo-cmp-cli": "^1.2.15",
51
51
  "husky": "^4.2.5",
52
52
  "lint-staged": "^10.2.9",
53
53
  "prettier": "^2.0.5"
@@ -51,7 +51,7 @@
51
51
  "@types/react": "^16.9.11",
52
52
  "@types/react-dom": "^16.9.15",
53
53
  "@types/axios": "^0.14.0",
54
- "neo-cmp-cli": "^1.2.13",
54
+ "neo-cmp-cli": "^1.2.15",
55
55
  "husky": "^4.2.5",
56
56
  "lint-staged": "^10.2.9",
57
57
  "prettier": "^2.0.5"
@@ -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.2.13",
50
+ "neo-cmp-cli": "^1.2.15",
51
51
  "husky": "^4.2.5",
52
52
  "lint-staged": "^10.2.9",
53
53
  "prettier": "^2.0.5",
@@ -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.2.13",
55
+ "neo-cmp-cli": "^1.2.15",
56
56
  "husky": "^4.2.5",
57
57
  "lint-staged": "^10.2.9",
58
58
  "prettier": "^2.0.5"
@@ -44,7 +44,7 @@
44
44
  "devDependencies": {
45
45
  "@commitlint/cli": "^8.3.5",
46
46
  "@commitlint/config-conventional": "^9.1.1",
47
- "neo-cmp-cli": "^1.2.13",
47
+ "neo-cmp-cli": "^1.2.15",
48
48
  "husky": "^4.2.5",
49
49
  "lint-staged": "^10.2.9",
50
50
  "prettier": "^2.0.5"
@@ -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.2.13",
49
+ "neo-cmp-cli": "^1.2.15",
50
50
  "husky": "^4.2.5",
51
51
  "lint-staged": "^10.2.9",
52
52
  "prettier": "^2.0.5"
@@ -44,7 +44,7 @@
44
44
  "devDependencies": {
45
45
  "@commitlint/cli": "^8.3.5",
46
46
  "@commitlint/config-conventional": "^9.1.1",
47
- "neo-cmp-cli": "^1.2.13",
47
+ "neo-cmp-cli": "^1.2.15",
48
48
  "husky": "^4.2.5",
49
49
  "lint-staged": "^10.2.9",
50
50
  "prettier": "^2.0.5",