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
文档https://umijs.org/zh/guide/faq.html#%E5%A6%82%E4%BD%95%E9%85%8D%E7%BD%AE%E9%A2%9D%E5%A4%96%E7%9A%84-loader。文档没有具体的配置postcss部分,我配置.umirc文件后,具体代码如下: import plugins from './postcss.config'; export default { plugins: [ [ 'umi-plugin-react', { dva: true } ] ], sass: {}, chainWebpack(config, { webpack }) { // 设置 alias //config.resolve.alias.set('a', 'path/to/a');
// 删除进度条插件 //config.plugins.delete('progress'); config.module.rule('css') .test(/\.(scss|css|less)$/) .use('css-loader') .loader('postcss-loader') }, disableCSSModules: true, extraPostCSSPlugins: plugins, cssLoaderOptions: {}
}; postcss.config.js文件代码如下: const plugins = [ require('postcss-at-rules-variables')(), require('postcss-import')(), require('postcss-mixins')(), require('postcss-bem')({ defaultNamespace: '', style: 'suit' }) ];
module.exports = plugins; npm run satrt 启动之后,一直报编译错误: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): ModuleBuildError: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
The text was updated successfully, but these errors were encountered:
No branches or pull requests
文档https://umijs.org/zh/guide/faq.html#%E5%A6%82%E4%BD%95%E9%85%8D%E7%BD%AE%E9%A2%9D%E5%A4%96%E7%9A%84-loader。文档没有具体的配置postcss部分,我配置.umirc文件后,具体代码如下:
import plugins from './postcss.config';
export default {
plugins: [
[
'umi-plugin-react',
{
dva: true
}
]
],
sass: {},
chainWebpack(config, { webpack }) {
// 设置 alias
//config.resolve.alias.set('a', 'path/to/a');
};
postcss.config.js文件代码如下:
const plugins = [
require('postcss-at-rules-variables')(),
require('postcss-import')(),
require('postcss-mixins')(),
require('postcss-bem')({
defaultNamespace: '',
style: 'suit'
})
];
module.exports = plugins;
npm run satrt 启动之后,一直报编译错误:
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
The text was updated successfully, but these errors were encountered: