akfun 3.2.9 → 3.2.10
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
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# AKFun 前端脚手架
|
|
2
|
-
> AKFun 是一个基于
|
|
2
|
+
> AKFun 是一个基于 Webpack 和 rollup 的前端多场景打包工具,支持多种技术栈:Vue技术栈、React技术栈、React&TS技术栈
|
|
3
3
|
- 核心理念:提供完整&全面的前端工程能力,并尽可能屏蔽掉前端工程相关配置,让开发者更专注业务研发工作。
|
|
4
|
-
- 技术栈:node/
|
|
4
|
+
- 技术栈:node/webpack/rollup/babel/eslint/stylelint
|
|
5
5
|
|
|
6
6
|
## 特性
|
|
7
7
|
- ⚡️ 零配置,开箱即用
|
|
8
8
|
- 👏 支持Vue和React项目的调试和构建
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
9
|
+
- 支持单页面和多页面
|
|
10
|
+
- 提供三种构建场景: 本地开发模式(包含热更新、接口代理等功能)、生产环境代码构建、library库构建(支持umd和esm的打包能力)
|
|
11
|
+
- 开放配置能力: 可配置构建入口文件、开启ESLint代码检测、接口代理等
|
|
12
|
+
- 支持 [Autoprefixer](https://github.com/postcss/autoprefixer#readme)、[Sass](https://sass-lang.com/)、[PostCSS](https://postcss.org/)、[ESLint](http://eslint.cn/)、[StyleLint](https://stylelint.io/)
|
|
13
|
+
- 支持项目系统参数自动批量替换 [params-replace-loader](https://www.npmjs.com/package/params-replace-loader)
|
|
14
|
+
- 提供完整的Vue和React项目模板
|
|
15
15
|
|
|
16
16
|
## 快速开始 / 使用方法一
|
|
17
17
|
> 全局安装AKFun,用于同时管理多个前端项目代码(可使用AKFun创建一个新项目)
|
package/package.json
CHANGED
|
@@ -22,7 +22,13 @@ module.exports = (akfunConfig) => {
|
|
|
22
22
|
curHtmlTemplate = config.webpack.template; // akfun.config.js中的webpack配置
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
let curTarget = ['web', 'es5'];
|
|
26
|
+
if (config.webpack.target) {
|
|
27
|
+
curTarget = config.webpack.target; // akfun.config.js中的webpack配置
|
|
28
|
+
}
|
|
29
|
+
|
|
25
30
|
const webpackDevConfig = merge(baseWebpackConfig, {
|
|
31
|
+
target: curTarget,
|
|
26
32
|
mode: curEnvConfig.NODE_ENV, // development模式,会启动NamedChunksPlugin、NamedModulesPlugin服务
|
|
27
33
|
output: {
|
|
28
34
|
publicPath: curEnvConfig.assetsPublicPath // 引用地址:配置发布到线上资源的URL前缀
|
|
@@ -15,7 +15,13 @@ module.exports = (akfunConfig) => {
|
|
|
15
15
|
// 获取webpack基本配置
|
|
16
16
|
const baseWebpackConfig = getBaseWebpackConfig(curEnvConfig, config);
|
|
17
17
|
|
|
18
|
+
let curTarget = ['web', 'es5'];
|
|
19
|
+
if (config.webpack.target) {
|
|
20
|
+
curTarget = config.webpack.target; // akfun.config.js中的webpack配置
|
|
21
|
+
}
|
|
22
|
+
|
|
18
23
|
const webpackLibConfig = merge(baseWebpackConfig, {
|
|
24
|
+
target: curTarget,
|
|
19
25
|
mode: curEnvConfig.NODE_ENV, // production 模式,会启动UglifyJsPlugin服务
|
|
20
26
|
output: {
|
|
21
27
|
path: curEnvConfig.assetsRoot, // 输出文件的存放在本地的目录
|
|
@@ -26,7 +26,13 @@ module.exports = (akfunConfig) => {
|
|
|
26
26
|
curHtmlTemplate = config.webpack.template; // akfun.config.js中的webpack配置
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
let curTarget = ['web', 'es5'];
|
|
30
|
+
if (config.webpack.target) {
|
|
31
|
+
curTarget = config.webpack.target; // akfun.config.js中的webpack配置
|
|
32
|
+
}
|
|
33
|
+
|
|
29
34
|
const webpackProdConfig = merge(baseWebpackConfig, {
|
|
35
|
+
target: curTarget,
|
|
30
36
|
mode: curEnvConfig.NODE_ENV, // production 模式,会启动UglifyJsPlugin服务
|
|
31
37
|
/*
|
|
32
38
|
内置变量列表:
|