akfun 3.3.1 → 3.3.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "akfun",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.3",
|
|
4
4
|
"description": "前端脚手架:支持Vue技术栈和react技术栈",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"前端工程",
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"@rollup/plugin-babel": "^5.3.0",
|
|
73
73
|
"@rollup/plugin-commonjs": "^21.0.1",
|
|
74
74
|
"@rollup/plugin-image": "^2.1.1",
|
|
75
|
+
"@svgr/rollup": "^8.1.0",
|
|
75
76
|
"@rollup/plugin-json": "^4.1.0",
|
|
76
77
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
77
78
|
"@rollup/plugin-typescript": "^8.3.1",
|
|
@@ -19,6 +19,8 @@ const nested = require('postcss-nested');
|
|
|
19
19
|
const postcssPresetEnv = require('postcss-preset-env');
|
|
20
20
|
// css代码压缩
|
|
21
21
|
const cssnano = require('cssnano');
|
|
22
|
+
// 处理svg文件
|
|
23
|
+
const svgr = require('@svgr/rollup');
|
|
22
24
|
const { externals } = require('rollup-plugin-node-externals');
|
|
23
25
|
const { resolveToCurrentRoot, resolveToCurrentDist } = require('../utils/pathUtils'); // 统一路径解析
|
|
24
26
|
const babelConfig = require('./babel.config'); // Babel的配置文件
|
|
@@ -85,6 +87,14 @@ module.exports = function (fileName, akfunConfig) {
|
|
|
85
87
|
cssnano()
|
|
86
88
|
]
|
|
87
89
|
}),
|
|
90
|
+
// https://react-svgr.com/docs/options/
|
|
91
|
+
svgr({
|
|
92
|
+
svgProps: {
|
|
93
|
+
className: 'icon'
|
|
94
|
+
},
|
|
95
|
+
prettier: false,
|
|
96
|
+
dimensions: false
|
|
97
|
+
}),
|
|
88
98
|
image(),
|
|
89
99
|
json()
|
|
90
100
|
],
|
|
@@ -3,6 +3,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin'); // 替换extrac
|
|
|
3
3
|
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
|
4
4
|
const CompressionWebpackPlugin = require('compression-webpack-plugin');
|
|
5
5
|
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
|
6
|
+
const deepMergeConfig = require('../utils/deepMergeConfig');
|
|
6
7
|
|
|
7
8
|
const utils = require('./loaderUtils');
|
|
8
9
|
// 引入当前项目配置文件
|
|
@@ -69,6 +70,11 @@ module.exports = (akfunConfig) => {
|
|
|
69
70
|
]
|
|
70
71
|
});
|
|
71
72
|
|
|
73
|
+
// 优先使用当前环境配置中的output
|
|
74
|
+
if (curEnvConfig.output) {
|
|
75
|
+
webpackLibConfig.output = deepMergeConfig(webpackLibConfig.output, curEnvConfig.output);
|
|
76
|
+
}
|
|
77
|
+
|
|
72
78
|
// 是否开启Gzip
|
|
73
79
|
if (curEnvConfig.productionGzip) {
|
|
74
80
|
webpackLibConfig.plugins.push(
|