🐷 Cli tool for creating react apps, configurable version of create-react-app.
2.72k
stars
340
forks
source link
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 4 years ago
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)