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 是一个基于 Webpack4.0 和 rollup 的前端多场景打包工具,支持多种技术栈:Vue技术栈、React技术栈、React&TS技术栈
2
+ > AKFun 是一个基于 Webpack 和 rollup 的前端多场景打包工具,支持多种技术栈:Vue技术栈、React技术栈、React&TS技术栈
3
3
  - 核心理念:提供完整&全面的前端工程能力,并尽可能屏蔽掉前端工程相关配置,让开发者更专注业务研发工作。
4
- - 技术栈:node/webpack4.0/rollup/babel/eslint/stylelint
4
+ - 技术栈:node/webpack/rollup/babel/eslint/stylelint
5
5
 
6
6
  ## 特性
7
7
  - ⚡️ 零配置,开箱即用
8
8
  - 👏 支持Vue和React项目的调试和构建
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项目模板
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akfun",
3
- "version": "3.2.9",
3
+ "version": "3.2.10",
4
4
  "description": "前端脚手架:支持Vue技术栈和react技术栈",
5
5
  "keywords": [
6
6
  "前端工程",
@@ -12,6 +12,7 @@ const defaultAKFunConfig = {
12
12
  enableStyleLintFix: false // 是否需要StyleLint自动修正代码格式
13
13
  },
14
14
  webpack: {
15
+ target: ['web', 'es5'],
15
16
  resolve: {
16
17
  // webpack的resolve配置
17
18
  extensions: ['.js', '.jsx', '.ts', '.tsx', '.vue', '.json'], // 用于配置webpack在尝试过程中用到的后缀列表
@@ -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
  内置变量列表: