akfun 3.1.6 → 3.1.7
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
|
@@ -44,7 +44,10 @@ exports.cssLoaders = function (options) {
|
|
|
44
44
|
return options.cssLoaderUrl;
|
|
45
45
|
}
|
|
46
46
|
// Don't handle `node_modules` urls
|
|
47
|
-
if (
|
|
47
|
+
if (
|
|
48
|
+
resourcePath.includes('node_modules') ||
|
|
49
|
+
(options.cssLoaderUrlDir && resourcePath.includes(options.cssLoaderUrlDir))
|
|
50
|
+
) {
|
|
48
51
|
return true;
|
|
49
52
|
}
|
|
50
53
|
return false;
|
|
@@ -6,6 +6,7 @@ const isProduction = process.NODE_ENV === 'production';
|
|
|
6
6
|
module.exports = {
|
|
7
7
|
loaders: utils.cssLoaders({
|
|
8
8
|
cssLoaderUrl: config.webpack.cssLoaderUrl, // 用于自定义css-loader配置项[url]
|
|
9
|
+
cssLoaderUrlDir: config.webpack.cssLoaderUrlDir, // 用于css-loader配置项[url]的生效目录
|
|
9
10
|
sourceMap: isProduction // 生产环境sourceMap是true
|
|
10
11
|
? config.build.productionSourceMap
|
|
11
12
|
: config.dev.cssSourceMap,
|
|
@@ -7,6 +7,7 @@ const projectConfig = require('../config/index');
|
|
|
7
7
|
const getBaseWebpackConfig = require('./webpack.base.conf');
|
|
8
8
|
const entrys2htmlWebpackPlugin = require('../utils/entrys2htmlWebpackPlugin');
|
|
9
9
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
10
|
+
const config = require('../config');
|
|
10
11
|
// const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
|
|
11
12
|
|
|
12
13
|
module.exports = (akfunConfig) => {
|
|
@@ -30,7 +31,8 @@ module.exports = (akfunConfig) => {
|
|
|
30
31
|
rules: utils.styleLoaders({
|
|
31
32
|
sourceMap: curEnvConfig.cssSourceMap,
|
|
32
33
|
environment: 'prod', // 'dev': 不会将css单独提取出来
|
|
33
|
-
cssLoaderUrl: config.webpack.cssLoaderUrl
|
|
34
|
+
cssLoaderUrl: config.webpack.cssLoaderUrl,
|
|
35
|
+
cssLoaderUrlDir: config.webpack.cssLoaderUrlDir
|
|
34
36
|
})
|
|
35
37
|
},
|
|
36
38
|
// devtool: '#cheap-module-eval-source-map', // 本地开发环境中的取值
|
|
@@ -32,7 +32,8 @@ module.exports = (akfunConfig) => {
|
|
|
32
32
|
rules: utils.styleLoaders({
|
|
33
33
|
sourceMap: curEnvConfig.productionSourceMap,
|
|
34
34
|
environment: 'prod',
|
|
35
|
-
cssLoaderUrl: config.webpack.cssLoaderUrl
|
|
35
|
+
cssLoaderUrl: config.webpack.cssLoaderUrl,
|
|
36
|
+
cssLoaderUrlDir: config.webpack.cssLoaderUrlDir
|
|
36
37
|
})
|
|
37
38
|
},
|
|
38
39
|
devtool: curEnvConfig.productionSourceMap ? curEnvConfig.devtool || 'source-map' : false, // 线上生成环境
|
|
@@ -47,7 +47,8 @@ module.exports = (akfunConfig) => {
|
|
|
47
47
|
rules: utils.styleLoaders({
|
|
48
48
|
sourceMap: curEnvConfig.productionSourceMap,
|
|
49
49
|
environment: 'prod',
|
|
50
|
-
cssLoaderUrl: config.webpack.cssLoaderUrl
|
|
50
|
+
cssLoaderUrl: config.webpack.cssLoaderUrl,
|
|
51
|
+
cssLoaderUrlDir: config.webpack.cssLoaderUrlDir
|
|
51
52
|
})
|
|
52
53
|
},
|
|
53
54
|
devtool: curEnvConfig.productionSourceMap ? curEnvConfig.devtool || 'source-map' : false, // 线上生成环境
|