akfun 3.2.13 → 3.2.15
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
|
@@ -28,6 +28,7 @@ const { buildBanner } = require('../utils/akfunParams');
|
|
|
28
28
|
module.exports = function (fileName, akfunConfig) {
|
|
29
29
|
const curConfig = akfunConfig || curProjectConfig;
|
|
30
30
|
const build2esm = curConfig.build2esm || {};
|
|
31
|
+
const curWebpackConfig = curConfig.webpack || {};
|
|
31
32
|
// 获取用户配置的构建入口文件
|
|
32
33
|
let rollupInput = resolveToCurrentRoot('src/main.js');
|
|
33
34
|
if (build2esm.input) {
|
|
@@ -41,6 +42,12 @@ module.exports = function (fileName, akfunConfig) {
|
|
|
41
42
|
// 增加babel配置
|
|
42
43
|
babelConfig.babelHelpers = 'runtime';
|
|
43
44
|
|
|
45
|
+
// 判断是否有自定义 Babel plugins
|
|
46
|
+
if (curWebpackConfig.babelPlugins && Array.isArray(curWebpackConfig.babelPlugins)) {
|
|
47
|
+
// 添加自定义webpack插件
|
|
48
|
+
babelConfig.plugins.push(...curWebpackConfig.babelPlugins);
|
|
49
|
+
}
|
|
50
|
+
|
|
44
51
|
return {
|
|
45
52
|
banner: buildBanner,
|
|
46
53
|
// format: build2esm.format || 'esm', // 生成包的格式
|
|
@@ -38,6 +38,13 @@ module.exports = (_curEnvConfig, _akfunConfig) => {
|
|
|
38
38
|
const curWebpackConfig = config.webpack;
|
|
39
39
|
// 获取当前项目目录
|
|
40
40
|
const curProjectDir = getProjectDir(curWebpackConfig.projectDir);
|
|
41
|
+
|
|
42
|
+
// 判断是否有自定义 Babel plugins
|
|
43
|
+
if (curWebpackConfig.babelPlugins && Array.isArray(curWebpackConfig.babelPlugins)) {
|
|
44
|
+
// 添加自定义webpack插件
|
|
45
|
+
babelConfig.plugins.push(...curWebpackConfig.babelPlugins);
|
|
46
|
+
}
|
|
47
|
+
|
|
41
48
|
const webpackConfig = {
|
|
42
49
|
stats: {
|
|
43
50
|
// cachedModules: false,
|