aurelia / webpack-plugin

A plugin for webpack that enables bundling Aurelia applications.
MIT License
90 stars 36 forks source link

Align CSS-doesn't-load wiki page to new version of css-loader #168

Closed rmja closed 4 years ago

rmja commented 4 years ago

I'm submitting a bug report

Please tell us about your environment:

Current behavior: The wiki page describing how to resolve the issue when css files are included directly from the template is not correct for the recently released css-loader version 4. The new version has changed the default of esModule from false to true breaking the included css. The sample code should instead be:

module: {
  rules: [
    {
      test: /\.css$/i,
      issuer: /\.html?$/i,
      use: [{ loader: "css-loader", options: { esModule: false }}]
    },
    {
      test: /\.css$/i,
      issuer: /\.[tj]s$/i,
      use: ["style-loader", "css-loader"]
    }
  ]
}

Expected/desired behavior: The documentation should align with the newest version of css-loader.

(I cannot figure out how to create a PR for the wiki)

elitastic commented 4 years ago

Many thanks for this info,

I also had this error and it made me crazy the last 4-5 hours till I found your post.

3cp commented 4 years ago

Note the above loader-webpack PR will fix this, requiring no user code/config change.

3cp commented 4 years ago

Fix in aurelia-loader-webpack 2.2.2 is released. @jods4 this can be closed.