question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] How about add postcssRegex in webpack config?

See original GitHub issue

Is your proposal related to a problem?

(Write your answer here.) Yes. When i want to use postcss(pcss), i have to override it.

const cssRule = oneOfRule.oneOf.find(rule => rule.test && rule.test.toString().includes('css'));
cssRule.test = /\.p?css$/;

How about add postcssRegex? (like sass and sassModule)

Describe the solution you’d like

packages/react-scripts/config/webpack.config.js

// style files regexes
const cssRegex = /\.css$/;
const cssModuleRegex = /\.module\.css$/;
const sassRegex = /\.(scss|sass)$/;
const sassModuleRegex = /\.module\.(scss|sass)$/;
const postcssRegex = /\.p?css$/;

...
{
  test: postcssRegex,
  use: getStyleLoaders(
    {
      importLoaders: 2,
      sourceMap: isEnvProduction && shouldUseSourceMap,
      modules: true,
    },
    'postcss-loader'
  )
},

Describe alternatives you’ve considered

Each user override config… may be with eject.

Additional context

(Write your answer here.)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
heyimalexcommented, Sep 10, 2019

No need to apologize! I’m the one who can only speak english 😂 Glad I could help.

0reactions
SoYoung210commented, Sep 10, 2019

@aobsefgmail I guess what you meant, but I won’t bother to comment. I ask you to take the above misleading expressions from the open source community. Please observe COC. Here’s an open source Repository that everyone sees.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I add parameter to chunk requests in the context of ...
Basically, all I needed to do was to: Create a standard webpack entry point named exactly the same as the federation library. Like...
Read more >
Bundling with webpack - Expo Documentation
Learn about different webpack bundler configurations that can be customized.
Read more >
request-env-webpack - npm
Webpack plugin that allow you to request environment variables from an url by using axios requests before build (or after, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found