0

I'm using the following module in my webpack config -

{
  test: /\.css$/,
  use: ExtractTextPlugin.extract({
    fallback: "style-loader",
    use: [
      {
        loader: "css-loader",
        options: {
          modules: true,
          localIdentName: "[name]-[local]-[hash:base64:5]"
        }
      },
      {
        loader: "postcss-loader"
      }
    ]
  })
}

I'm getting an error Uncaught Error: Module build failed: ModuleNotFoundError: Module not found: Error: Can't resolve 'shared/variables

It looks like my css can't import files. Any idea what I'm doing wrong?

I'm using webpack 3.5.5 and extract text plugin 3.0.0

Finnnn
  • 3,530
  • 6
  • 46
  • 69
  • 6 years in stackoverflow... I would expect that you know how to use the code-block syntax in your question :( – Dekel Sep 02 '17 at 17:01
  • @Dekel I'd expect stackoverflow to supprt markdown like everyone else – Finnnn Sep 02 '17 at 17:05
  • Well... until they do - use what you have. it really isn't hard to select the relevant code and click on the `{}` button. – Dekel Sep 02 '17 at 17:06
  • fixed it. Any input on the question? I imagine you're an absolute joy in PR reviews. – Finnnn Sep 02 '17 at 17:08
  • It looks like webpack is looking for some module that doesn't exist. Did you `npm install`? Do you have all the relevant modules in the `package.json` file? – Dekel Sep 02 '17 at 17:11
  • @Dekel I think you're right, I'd forgotten to configure webpack to accept css files. Thanks! Post an answer and I'll click accept. – Finnnn Sep 02 '17 at 18:39

0 Answers0