qmzreact 1.0.16 → 1.0.18

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/conf/build.js CHANGED
@@ -25,7 +25,8 @@ module.exports = function buildPackage() {
25
25
  children: false,
26
26
  chunks: false,
27
27
  chunkModules: false
28
- }) + '\n')
28
+ }) + '\n');
29
+ process.exit(0); // 退出进程
29
30
  })
30
31
  }
31
32
 
@@ -8,12 +8,6 @@ var sassGlobalStyles = '';
8
8
  processConfig.sassGlobalStyles.forEach((item) => {
9
9
  return sassGlobalStyles += `@import "${item}";`;
10
10
  });
11
- try {
12
- fs.accessSync(utils.rootPath('src/global.scss'), fs.constants.F_OK);
13
- sassGlobalStyles += `@import "@/global.scss";`;
14
- } catch (err) {
15
- // console.log(err);
16
- };
17
11
  module.exports = [
18
12
  {
19
13
  test: /\.t|jsx?$/,
@@ -126,14 +120,13 @@ module.exports = [
126
120
  // 3. 自定义函数:遇到 node_modules 就“放行”,否则“使用上面的规则”
127
121
  getLocalIdent: (context, localIdentName, localName, options) => {
128
122
  // 如果是 node_modules 里的文件
129
- if (context.resourcePath.includes('node_modules')) {
123
+ if (/\.module\.(sa|sc|c)ss$/i.test(context.resourcePath)) {
130
124
  // 直接返回原始类名(相当于变相的 global 模式)
131
- return localName;
125
+ return null;
132
126
  }
133
-
134
127
  // 如果是自己 src 里的文件
135
128
  // 返回 null,告诉 css-loader:“请用 localIdentName 的规则去生成哈希”
136
- return null;
129
+ return localName;
137
130
  }
138
131
  }
139
132
  }, processConfig.cssLoaderOptions)
@@ -9,13 +9,20 @@ var AddAssetHtmlPlugin = require('add-asset-html-webpack-plugin');
9
9
  var fs = require('fs');
10
10
 
11
11
  var entry = [];
12
+ try {
13
+ var globalPath = utils.rootPath('src/global.scss');
14
+ fs.accessSync(globalPath, fs.constants.F_OK);
15
+ entry.push(globalPath);
16
+ } catch (err) {
17
+ // console.log(err);
18
+ };
12
19
  var entryFile = ['index.js', 'index.jsx', 'index.ts', 'index.tsx'];
13
20
  for (var i = 0; i < entryFile.length; i++) {
14
21
  var entryPath = utils.rootPath(processConfig.compileDir, entryFile[i]);
15
22
  try {
16
23
  const stats = fs.statSync(entryPath);
17
24
  if (stats.isFile()) {
18
- entry = [entryPath];
25
+ entry.push(entryPath);
19
26
  }
20
27
  break;
21
28
  } catch (err) {
@@ -23,6 +30,7 @@ for (var i = 0; i < entryFile.length; i++) {
23
30
  }
24
31
  }
25
32
 
33
+
26
34
  var plugins = [];
27
35
  if (processConfig.dll) {
28
36
  plugins = [
@@ -38,6 +46,8 @@ if (processConfig.dll) {
38
46
  })
39
47
  ]
40
48
  }
49
+
50
+
41
51
  module.exports = {
42
52
  entry: [
43
53
  ...processConfig.entry,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qmzreact",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "前端react本地启动服务和打包工具",
5
5
  "author": {
6
6
  "name": "qmz",