Skip to content
New issue

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

Module build failed:var content = require("!!../../../../css-loader/index.js!../../../../postcss-loader/lib/index.js!../../../../less-loader/dist/cjs.js??ref--13-3!./index.less"); ^ Unrecognised input in C:\workSpace\git\dap\node_modules\antd\es\auto-complete\style\index.less (line 2, column 12) #882

Open
zjscy666 opened this issue Aug 5, 2020 · 1 comment

Comments

@zjscy666
Copy link

zjscy666 commented Aug 5, 2020

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/"
}
},

"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;
};

What do you expected?(预期的正常效果)

What happen?(发生了何种非正常现象)

Re-producible online demo (可复现的在线demo)

@jackmovestart
Copy link

后来解决了么 老哥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants