We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"dva": "^2.4.1",
我用的dva,只不过配置是按照roadhog来的
这是.webpackrc的配置 "env": { "development": { "publicPath": "/" }, "production": { "publicPath": "/dapnew/" } },
"extraBabelPlugins": [ ["import", {"libraryName": "antd", "libraryDirectory": "es", "style": true }] ]
这是webpack.config.js的配置 const CompressionWebpackPlugin = require('compression-webpack-plugin'); const productionGzipExtensions = ["js", "css"];
module.exports = (config, { webpack }) => { config.module.rules.push({ test: /.(css|less)$/, use: [ "style-loader", "css-loader", "postcss-loader", { loader: "less-loader", options: { modifyVars: { 'ant-prefix': 'ant11' }, javascriptEnabled: true, } } ], }); // add plugins config.plugins.push(new CompressionWebpackPlugin({ filename: "[path].gz[query]", algorithm: "gzip", test: new RegExp("\.(" + productionGzipExtensions.join("|") + ")$"), //匹配文件名 threshold: 10240, //对10K以上的数据进行压缩 minRatio: 0.8, deleteOriginalAssets: false //是否删除源文件 })) return config; };
The text was updated successfully, but these errors were encountered:
后来解决了么 老哥
Sorry, something went wrong.
No branches or pull requests
Environment(required) | 环境(必填)
"dva": "^2.4.1",
What did you do? Please provide steps to re-produce your problem.(请提供复现步骤)
我用的dva,只不过配置是按照roadhog来的
这是.webpackrc的配置
"env": {
"development": {
"publicPath": "/"
},
"production": {
"publicPath": "/dapnew/"
}
},
这是webpack.config.js的配置
const CompressionWebpackPlugin = require('compression-webpack-plugin');
const productionGzipExtensions = ["js", "css"];
module.exports = (config, {
webpack
}) => {
config.module.rules.push({
test: /.(css|less)$/,
use: [
"style-loader",
"css-loader",
"postcss-loader",
{
loader: "less-loader",
options: {
modifyVars: {
'ant-prefix': 'ant11'
},
javascriptEnabled: true,
}
}
],
});
// add plugins
config.plugins.push(new CompressionWebpackPlugin({
filename: "[path].gz[query]",
algorithm: "gzip",
test: new RegExp("\.(" + productionGzipExtensions.join("|") + ")$"), //匹配文件名
threshold: 10240, //对10K以上的数据进行压缩
minRatio: 0.8,
deleteOriginalAssets: false //是否删除源文件
}))
return config;
};
What do you expected?(预期的正常效果)
What happen?(发生了何种非正常现象)
Re-producible online demo (可复现的在线demo)
The text was updated successfully, but these errors were encountered: