Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #7657
Closed
Open
Issue created Sep 07, 2019 by Administrator@rootContributor

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

Created by: SoYoung210

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.)

Assignee
Assign to
Time tracking