akfun 3.2.19 → 3.2.20

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.2.19",
3
+ "version": "3.2.20",
4
4
  "description": "前端脚手架:支持Vue技术栈和react技术栈",
5
5
  "keywords": [
6
6
  "前端工程",
@@ -52,7 +52,8 @@ exports.cssLoaders = function (options) {
52
52
  return true;
53
53
  }
54
54
  },
55
- sourceMap: options.sourceMap
55
+ sourceMap: options.sourceMap,
56
+ ...(options.cssLoaderOption || {})
56
57
  }
57
58
  };
58
59
 
@@ -7,6 +7,7 @@ module.exports = {
7
7
  loaders: utils.cssLoaders({
8
8
  cssLoaderUrl: config.webpack.cssLoaderUrl, // 用于自定义css-loader配置项[url]
9
9
  cssLoaderUrlDir: config.webpack.cssLoaderUrlDir, // 用于设置css-loader配置项[url]的生效目录
10
+ cssLoaderOption: config.webpack.cssLoaderOption, // 用于自定义css-loader配置项(优先级最高)
10
11
  sassOptions: config.webpack.sassOptions, // 用于设置sass-loader配置项
11
12
  sourceMap: isProduction // 生产环境sourceMap是true
12
13
  ? config.build.productionSourceMap
@@ -33,12 +33,18 @@ module.exports = (akfunConfig) => {
33
33
  output: {
34
34
  publicPath: curEnvConfig.assetsPublicPath // 引用地址:配置发布到线上资源的URL前缀
35
35
  },
36
+ resolve: {
37
+ // dev环境默认使用 require
38
+ conditionNames: ['require'],
39
+ ...baseWebpackConfig.resolve,
40
+ },
36
41
  module: {
37
42
  rules: utils.styleLoaders({
38
43
  sourceMap: curEnvConfig.cssSourceMap,
39
44
  environment: 'prod', // 'dev': 不会将css单独提取出来
40
45
  cssLoaderUrl: config.webpack.cssLoaderUrl,
41
- cssLoaderUrlDir: config.webpack.cssLoaderUrlDir
46
+ cssLoaderUrlDir: config.webpack.cssLoaderUrlDir,
47
+ cssLoaderOption: config.webpack.cssLoaderOption, // 用于自定义css-loader配置项(优先级最高)
42
48
  })
43
49
  },
44
50
  // devtool: '#cheap-module-eval-source-map', // 本地开发环境中的取值
@@ -39,7 +39,8 @@ module.exports = (akfunConfig) => {
39
39
  sourceMap: curEnvConfig.productionSourceMap,
40
40
  environment: 'prod',
41
41
  cssLoaderUrl: config.webpack.cssLoaderUrl,
42
- cssLoaderUrlDir: config.webpack.cssLoaderUrlDir
42
+ cssLoaderUrlDir: config.webpack.cssLoaderUrlDir,
43
+ cssLoaderOption: config.webpack.cssLoaderOption, // 用于自定义css-loader配置项(优先级最高)
43
44
  })
44
45
  },
45
46
  devtool: curEnvConfig.productionSourceMap ? curEnvConfig.devtool || 'source-map' : false, // 线上生成环境
@@ -53,7 +53,8 @@ module.exports = (akfunConfig) => {
53
53
  sourceMap: curEnvConfig.productionSourceMap,
54
54
  environment: 'prod',
55
55
  cssLoaderUrl: config.webpack.cssLoaderUrl,
56
- cssLoaderUrlDir: config.webpack.cssLoaderUrlDir
56
+ cssLoaderUrlDir: config.webpack.cssLoaderUrlDir,
57
+ cssLoaderOption: config.webpack.cssLoaderOption, // 用于自定义css-loader配置项(优先级最高)
57
58
  })
58
59
  },
59
60
  devtool: curEnvConfig.productionSourceMap ? curEnvConfig.devtool || 'source-map' : false, // 线上生成环境