akfun 5.0.0 → 5.0.2
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 +1 -1
- package/src/config/babel.config.js +1 -1
- package/src/config/rollup.config.js +3 -1
- package/src/initData/config/.gitignore +47 -0
- package/src/webpack/webpack.base.conf.js +2 -0
- package/src/webpack/webpack.dev.conf.js +2 -2
- package/src/webpack/webpack.library.conf.js +1 -1
- package/src/webpack/webpack.prod.conf.js +1 -1
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ module.exports = {
|
|
|
16
16
|
plugins: [
|
|
17
17
|
// ['import', { libraryName: 'antd', style: 'css' }], // babel-plugin-import: antd的按需加载
|
|
18
18
|
['@babel/plugin-transform-runtime'],
|
|
19
|
-
['@babel/plugin-proposal-decorators', { legacy: true }],
|
|
19
|
+
['@babel/plugin-proposal-decorators', { legacy: true }], // 启用装饰器语法支持
|
|
20
20
|
'@babel/plugin-proposal-function-sent',
|
|
21
21
|
'@babel/plugin-proposal-export-namespace-from',
|
|
22
22
|
'@babel/plugin-proposal-numeric-separator',
|
|
@@ -31,6 +31,7 @@ module.exports = function (fileName, akfunConfig) {
|
|
|
31
31
|
const curConfig = akfunConfig || projectConfig;
|
|
32
32
|
const build2esm = curConfig.build2esm || {};
|
|
33
33
|
const curWebpackConfig = curConfig.webpack || {};
|
|
34
|
+
const buildType = build2esm.type || 'ts';
|
|
34
35
|
// 获取用户配置的构建入口文件
|
|
35
36
|
let rollupInput = resolveToCurrentRoot('src/main.js');
|
|
36
37
|
if (build2esm.input) {
|
|
@@ -70,9 +71,10 @@ module.exports = function (fileName, akfunConfig) {
|
|
|
70
71
|
nodeResolve({
|
|
71
72
|
extensions: curConfig.webpack.resolve.extensions
|
|
72
73
|
}),
|
|
73
|
-
typescript(),
|
|
74
|
+
buildType === 'ts' ? typescript() : undefined,
|
|
74
75
|
babel(babelConfig), // 备注,需要先babel()再commjs()
|
|
75
76
|
// jsx( {factory: 'React.createElement'} ),
|
|
77
|
+
buildType === 'ts' ? jsx( {factory: 'React.createElement'} ) : undefined,
|
|
76
78
|
vue(),
|
|
77
79
|
commonjs(),
|
|
78
80
|
postcss({
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Numerous always-ignore extensions
|
|
2
|
+
*.bak
|
|
3
|
+
*.patch
|
|
4
|
+
*.diff
|
|
5
|
+
*.err
|
|
6
|
+
|
|
7
|
+
# temp file for git conflict merging
|
|
8
|
+
*.orig
|
|
9
|
+
*.log
|
|
10
|
+
*.rej
|
|
11
|
+
*.swo
|
|
12
|
+
*.swp
|
|
13
|
+
*.zip
|
|
14
|
+
*.vi
|
|
15
|
+
*~
|
|
16
|
+
*.sass-cache
|
|
17
|
+
*.tmp.html
|
|
18
|
+
*.dump
|
|
19
|
+
|
|
20
|
+
# OS or Editor folders
|
|
21
|
+
.DS_Store
|
|
22
|
+
._*
|
|
23
|
+
.cache
|
|
24
|
+
.project
|
|
25
|
+
.settings
|
|
26
|
+
.tmproj
|
|
27
|
+
*.esproj
|
|
28
|
+
*.sublime-project
|
|
29
|
+
*.sublime-workspace
|
|
30
|
+
nbproject
|
|
31
|
+
thumbs.db
|
|
32
|
+
*.iml
|
|
33
|
+
.vscode/
|
|
34
|
+
|
|
35
|
+
# Folders to ignore
|
|
36
|
+
.hg
|
|
37
|
+
.svn
|
|
38
|
+
.CVS
|
|
39
|
+
.idea
|
|
40
|
+
node_modules/
|
|
41
|
+
jscoverage_lib/
|
|
42
|
+
.svn
|
|
43
|
+
|
|
44
|
+
# log files
|
|
45
|
+
npm-debug.log*
|
|
46
|
+
yarn-debug.log*
|
|
47
|
+
yarn-error.log*
|
|
@@ -77,6 +77,7 @@ module.exports = (_curEnvConfig, _akfunConfig) => {
|
|
|
77
77
|
? [
|
|
78
78
|
nodeExternals({
|
|
79
79
|
importType: 'commonjs',
|
|
80
|
+
additionalModuleDirs: curWebpackConfig.additionalModuleDirs || [],
|
|
80
81
|
allowlist: curWebpackConfig.allowList ? curWebpackConfig.allowList : []
|
|
81
82
|
})
|
|
82
83
|
].concat(curWebpackConfig.externals)
|
|
@@ -214,6 +215,7 @@ module.exports = (_curEnvConfig, _akfunConfig) => {
|
|
|
214
215
|
? [
|
|
215
216
|
nodeExternals({
|
|
216
217
|
importType: 'commonjs',
|
|
218
|
+
additionalModuleDirs: curEnvConfig.additionalModuleDirs || curWebpackConfig.additionalModuleDirs || [],
|
|
217
219
|
allowlist: allowList || []
|
|
218
220
|
})
|
|
219
221
|
].concat(externals)
|
|
@@ -51,8 +51,8 @@ module.exports = (akfunConfig) => {
|
|
|
51
51
|
devtool: curEnvConfig.productionSourceMap ? curEnvConfig.devtool || 'eval-source-map' : 'eval', // 开发环境
|
|
52
52
|
optimization: {
|
|
53
53
|
chunkIds: 'named', // named 对调试更友好的可读的 id。
|
|
54
|
-
emitOnErrors: true
|
|
55
|
-
minimize: false
|
|
54
|
+
emitOnErrors: true
|
|
55
|
+
// minimize: false
|
|
56
56
|
},
|
|
57
57
|
plugins: [
|
|
58
58
|
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
|
|
@@ -53,7 +53,7 @@ module.exports = (akfunConfig) => {
|
|
|
53
53
|
*/
|
|
54
54
|
chunkIds: 'named',
|
|
55
55
|
emitOnErrors: true,
|
|
56
|
-
minimize: true,
|
|
56
|
+
// minimize: true,
|
|
57
57
|
minimizer: [
|
|
58
58
|
// For webpack@5 you can use the `...` syntax to extend existing minimizers (i.e. `terser-webpack-plugin`), uncomment the next line
|
|
59
59
|
`...`,
|