【问题标题】:Webpack throws POSTCSS wrong configuration errorsWebpack 抛出 POSTCSS 错误配置错误
【发布时间】:2017-04-04 13:04:11
【问题描述】:

我正在尝试更新到 webpack 2,但我陷入了 css 后加载阶段。这是我的相关代码:

    {
      test: /\.scss$/,
      loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader!postcss-loader!sass-loader?outputStyle=expanded&sourceComments=true'}),
      exclude: /\/custom-apps\/|future/
    },
    {
      test: /\.scss$/,
      loader: 'style-loader!css-loader?modules&localIdentName=[local]___[hash:base64:5]&importLoaders=2!postcss-loader!sass-loader?outputStyle=expanded&sourceComments=true',
      include: /\/custom-apps\/|future/
    },

我得到的错误:

PostCSS Config could not be loaded. Please check your PostCSS Config.

【问题讨论】:

    标签: webpack postcss extracttextwebpackplugin


    【解决方案1】:

    在项目根路径添加本地文件

    postcss.config.js

    内容:

    module.exports = {
      importLoaders: 1,
    };
    

    为我做的。

    还放 !postcss-loader?importLoaders: 1 在我的示例代码中我认为应该可以工作。

    【讨论】:

      猜你喜欢
      • 2017-04-16
      • 2016-10-26
      • 2021-06-28
      • 2018-09-18
      • 1970-01-01
      • 2018-03-25
      • 2017-08-16
      • 2018-10-11
      • 1970-01-01
      相关资源
      最近更新 更多