@autobest-ui/scripts 1.0.3 → 1.0.4

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.
@@ -1,10 +1,26 @@
1
+ const fs = require('fs');
1
2
  const { getProjectPath } = require('./utils');
2
3
 
4
+ let pkgInfo = {
5
+ name: 'ui',
6
+ version: '1.0.0'
7
+ };
8
+ try {
9
+ const pkgPath = getProjectPath('/package.json');
10
+ const pkgStr = fs.readFileSync(pkgPath);
11
+ pkgInfo = JSON.parse(pkgStr);
12
+ } catch (e) {
13
+ // eslint-disable-next-line no-console
14
+ console.warn('The current project does not have a package.json file or content error!!!');
15
+ }
16
+
3
17
  const configPath = getProjectPath('/config/app.config.js');
4
18
 
5
19
  const config = require(configPath);
6
20
 
7
21
  module.exports = {
22
+ projectName: pkgInfo.name,
23
+ projectVersion: pkgInfo.version,
8
24
  startDefaultPort: 3030,
9
25
  startEntry: '/src/index.tsx',
10
26
  ...config
@@ -88,6 +88,17 @@ module.exports = (appConfig, extendEnv, { isProd, isServer, isHotServer }) => {
88
88
  output: {
89
89
  publicPath: '/'
90
90
  },
91
+ cache: {
92
+ type: 'filesystem',
93
+ version: `${appConfig.projectName}_${isProd ? '1' : '0'}${isServer ? '1' : '0'}${isHotServer ? '1' : '0'}_${
94
+ appConfig.projectVersion
95
+ }`,
96
+ store: 'pack',
97
+ buildDependencies: {
98
+ defaultWebpack: ['webpack/lib/'],
99
+ config: [__filename]
100
+ }
101
+ },
91
102
  // 配置各种loader
92
103
  module: {
93
104
  // 警告替换为Error
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobest-ui/scripts",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "private": false,
5
5
  "description": "utils for project tools",
6
6
  "bin": {
@@ -91,5 +91,5 @@
91
91
  "webpack-merge": "5.8.0",
92
92
  "webpack-node-externals": "3.0.0"
93
93
  },
94
- "gitHead": "704a5a26ee09a6f551bca87a5d40bf5992356317"
94
+ "gitHead": "e21c31cc3b068c08fae9a56ec64ef07ddd0f780a"
95
95
  }