Skip to content
New issue

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

plugins added through webpack.config.js should have higher priority than the Flow-default #347

Open
vlukashov opened this issue Nov 15, 2019 · 2 comments
Labels

Comments

@vlukashov
Copy link

I want to use a different webpack loader for .css files (NOTE: Flow generates a webpack.generated.js that uses raw-loader for that).

This is what I have in webpack.config.js

module.exports = merge(flowDefaults, {
  module: {
    rules: [
      {
        test: /\.css$/i,
        loader: "lit-css-loader"
      }
    ]
  }
});

I want that to be sufficient to override the Flow defaults. With Flow 3.0.0.alpha7 it is not.

Investigation:

So the problem is that the merge appends new values to the other, try this:

module.exports = merge(flowDefaults, {
  module: {
    rules: [
      {
        test: /\.css$/i,
        use: ['lit-css-loader']
      }
    ]
  },
});
console.log(module.exports.module.rules);

then run webpack and you get

[ { test: /\.js$/, use: [ [BabelMultiTargetLoader] ] },
  { test: /\.ts$/,
    use: [ [BabelMultiTargetLoader], 'awesome-typescript-loader' ] },
  { test: /\.css$/i, use: [ 'raw-loader' ] },
  { test: /\.css$/i, use: [ 'lit-css-loader' ] } ]
@vlukashov vlukashov added the DX label Nov 15, 2019
@pleku pleku added the hilla Issues related to Hilla label Nov 18, 2019
@vaadin-bot vaadin-bot transferred this issue from vaadin/flow Mar 4, 2022
@platosha
Copy link
Contributor

Also consider priorities for vite.config.ts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants