@autobest-ui/scripts 1.0.2 → 1.0.3
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/README.md +1 -1
- package/common/webpack.common.js +11 -4
- package/package.json +2 -2
- package/ssrConfig/webpack.base.js +2 -2
- package/ssrConfig/webpack.dev.client.js +0 -1
- package/ssrConfig/webpack.dev.js +0 -1
- package/ssrConfig/webpack.dev.server.js +0 -1
- package/ssrConfig/webpack.prod.client.js +0 -3
- package/ssrConfig/webpack.prod.server.js +0 -3
package/README.md
CHANGED
package/common/webpack.common.js
CHANGED
|
@@ -77,7 +77,7 @@ function getStyleLoaders({ isProd, isServer, isHotServer, isSass, moduleOption =
|
|
|
77
77
|
return result;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
module.exports = (appConfig, extendEnv, { isProd, isServer, isHotServer
|
|
80
|
+
module.exports = (appConfig, extendEnv, { isProd, isServer, isHotServer }) => {
|
|
81
81
|
const result = {
|
|
82
82
|
stats: 'errors-only',
|
|
83
83
|
// 原始源代码(仅限行)定位到原始代码问题,比source-map 快,但是没有列映射(column mapping)的 source-map
|
|
@@ -97,7 +97,15 @@ module.exports = (appConfig, extendEnv, { isProd, isServer, isHotServer, isSetCo
|
|
|
97
97
|
oneOf: [
|
|
98
98
|
{
|
|
99
99
|
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
|
|
100
|
-
type: 'asset'
|
|
100
|
+
type: 'asset',
|
|
101
|
+
parser: {
|
|
102
|
+
dataUrlCondition: {
|
|
103
|
+
maxSize: 2048
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
generator: {
|
|
107
|
+
filename: `static/[name].[contenthash:8].[ext]?v=${extendEnv.version}`
|
|
108
|
+
}
|
|
101
109
|
},
|
|
102
110
|
{
|
|
103
111
|
test: /\.(js|ts|tsx)$/,
|
|
@@ -225,8 +233,7 @@ module.exports = (appConfig, extendEnv, { isProd, isServer, isHotServer, isSetCo
|
|
|
225
233
|
const extendResult = extendConfig(result, appConfig, extendEnv, {
|
|
226
234
|
isProd,
|
|
227
235
|
isServer,
|
|
228
|
-
isHotServer
|
|
229
|
-
isSetCommonAlias
|
|
236
|
+
isHotServer
|
|
230
237
|
});
|
|
231
238
|
if (!extendResult) {
|
|
232
239
|
throw Error(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autobest-ui/scripts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
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": "
|
|
94
|
+
"gitHead": "704a5a26ee09a6f551bca87a5d40bf5992356317"
|
|
95
95
|
}
|
|
@@ -2,7 +2,7 @@ const { merge } = require('webpack-merge');
|
|
|
2
2
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
3
3
|
const webpackCommon = require('../common/webpack.common');
|
|
4
4
|
|
|
5
|
-
module.exports = (appConfig, extendEnv, { isServer, isHotServer,
|
|
5
|
+
module.exports = (appConfig, extendEnv, { isServer, isHotServer, isProd }) => {
|
|
6
6
|
const result = {
|
|
7
7
|
plugins: [],
|
|
8
8
|
module: {
|
|
@@ -19,5 +19,5 @@ module.exports = (appConfig, extendEnv, { isServer, isHotServer, isSetCommonAlia
|
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
return merge(webpackCommon(appConfig, extendEnv, { isProd, isServer, isHotServer
|
|
22
|
+
return merge(webpackCommon(appConfig, extendEnv, { isProd, isServer, isHotServer }), result);
|
|
23
23
|
};
|
package/ssrConfig/webpack.dev.js
CHANGED
|
@@ -5,14 +5,11 @@ const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
|
|
5
5
|
const { getProjectPath } = require('../common/utils');
|
|
6
6
|
const baseConfig = require('./webpack.base');
|
|
7
7
|
|
|
8
|
-
const isCommonBuild = process.env.REACT_APP_BUILD_TYPE === 'common';
|
|
9
|
-
|
|
10
8
|
module.exports = function (appConfig, extendEnv) {
|
|
11
9
|
return merge(
|
|
12
10
|
baseConfig(appConfig, extendEnv, {
|
|
13
11
|
isServer: false,
|
|
14
12
|
isHotServer: false,
|
|
15
|
-
isSetCommonAlias: isCommonBuild,
|
|
16
13
|
isProd: true
|
|
17
14
|
}),
|
|
18
15
|
{
|
|
@@ -3,14 +3,11 @@ const { merge } = require('webpack-merge');
|
|
|
3
3
|
const { getProjectPath } = require('../common/utils');
|
|
4
4
|
const baseConfig = require('./webpack.base');
|
|
5
5
|
|
|
6
|
-
const isCommonBuild = process.env.REACT_APP_BUILD_TYPE === 'common';
|
|
7
|
-
|
|
8
6
|
module.exports = function (appConfig, extendEnv) {
|
|
9
7
|
return merge(
|
|
10
8
|
baseConfig(appConfig, extendEnv, {
|
|
11
9
|
isServer: true,
|
|
12
10
|
isHotServer: false,
|
|
13
|
-
isSetCommonAlias: isCommonBuild,
|
|
14
11
|
isProd: true
|
|
15
12
|
}),
|
|
16
13
|
{
|