@vnejs/build 0.0.17 → 0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/build",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "description": "Build tools for @vnejs",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -16,6 +16,7 @@
16
16
  "author": "",
17
17
  "license": "ISC",
18
18
  "dependencies": {
19
+ "commander": "13.1.0",
19
20
  "@bem-react/classname": "1.5.12",
20
21
  "lodash.merge": "4.6.2",
21
22
  "webpack": "^5.88.1",
@@ -7,16 +7,16 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
7
7
  const isDev = process.env.NODE_ENV === "development";
8
8
 
9
9
  const getScriptLoader = (nodeModulesPath) => ({
10
- loader: `${nodeModulesPath}/babel-loader`,
10
+ loader: `babel-loader`,
11
11
  options: {
12
12
  plugins: [
13
- `${nodeModulesPath}/@babel/plugin-syntax-dynamic-import`,
14
- `${nodeModulesPath}/@babel/plugin-proposal-class-properties`,
15
- `${nodeModulesPath}/@loadable/babel-plugin`,
13
+ `@babel/plugin-syntax-dynamic-import`,
14
+ `@babel/plugin-proposal-class-properties`,
15
+ `@loadable/babel-plugin`,
16
16
  ],
17
17
  presets: [
18
- `${nodeModulesPath}/@babel/preset-react`,
19
- [`${nodeModulesPath}/@babel/preset-env`, { useBuiltIns: "entry", corejs: "core-js@3", modules: "commonjs" }],
18
+ `@babel/preset-react`,
19
+ [`@babel/preset-env`, { useBuiltIns: "entry", corejs: "core-js@3", modules: "commonjs" }],
20
20
  ],
21
21
  cacheDirectory: true,
22
22
  caller: { target: "clientside", name: "babel-loader" },
@@ -25,15 +25,15 @@ const getScriptLoader = (nodeModulesPath) => ({
25
25
 
26
26
  const getCssLoader = (nodeModulesPath) => [
27
27
  // MiniCssExtractPlugin.loader,
28
- { loader: `${nodeModulesPath}/style-loader` },
29
- { loader: `${nodeModulesPath}/css-loader` },
28
+ { loader: `style-loader` },
29
+ { loader: `css-loader` },
30
30
  ];
31
31
 
32
32
  const getStylusLoader = (nodeModulesPath) => [
33
33
  // MiniCssExtractPlugin.loader,
34
- { loader: `${nodeModulesPath}/style-loader` },
35
- { loader: `${nodeModulesPath}/css-loader` },
36
- { loader: `${nodeModulesPath}/stylus-loader` },
34
+ { loader: `style-loader` },
35
+ { loader: `css-loader` },
36
+ { loader: `stylus-loader` },
37
37
  ];
38
38
 
39
39
  module.exports = (rootPath, options) => {
@@ -54,13 +54,7 @@ module.exports = (rootPath, options) => {
54
54
  target: "web",
55
55
  entry: {
56
56
  index: { import: entry, chunkLoading: false, dependOn: "vendors" },
57
- vendors: [
58
- `${nodeModulesPath}/regenerator-runtime`,
59
- `${nodeModulesPath}/setimmediate`,
60
- `${nodeModulesPath}/react`,
61
- `${nodeModulesPath}/react-dom`,
62
- `${nodeModulesPath}/@bem-react/classname`,
63
- ],
57
+ vendors: [`regenerator-runtime`, `setimmediate`, `react`, `react-dom`, `@bem-react/classname`],
64
58
  },
65
59
  optimization: { minimize: true },
66
60
  resolve: {
@@ -81,7 +75,7 @@ module.exports = (rootPath, options) => {
81
75
  { test: /\.m?(t|j)sx?$/, include: /node_modules\/@vnejs/, use: getScriptLoader(nodeModulesPath) },
82
76
  { test: /\.css$/, use: getCssLoader(nodeModulesPath) },
83
77
  { test: /\.styl$/, use: getStylusLoader(nodeModulesPath) },
84
- { test: /\.(jpe?g|png|ttf|gif|eot|svg|woff)$/, use: [{ loader: `${nodeModulesPath}/base64-inline-loader` }] },
78
+ { test: /\.(jpe?g|png|ttf|gif|eot|svg|woff)$/, use: [{ loader: `base64-inline-loader` }] },
85
79
  ],
86
80
  },
87
81
  };
package/src/data/utils.js CHANGED
@@ -122,6 +122,8 @@ const runBuildData = ({ modDir } = {}) => {
122
122
  let curLabel2 = null;
123
123
 
124
124
  const kek = lines.reduce((acc, line) => {
125
+ if (!line) return acc;
126
+
125
127
  if (labelReg.test(line)) {
126
128
  let { name } = line.match(labelReg).groups;
127
129