Skip to content

Re-building development bundle slow in v3 #31479

Answered by tu4mo
tu4mo asked this question in Help
Discussion options

You must be logged in to vote

Ok, I figured it out. Like I suspected earlier, dependencies installed from workspaces go through babel-loader, maybe because they aren't physically inside node_modules but symlinks. I added my custom exclude for js loaders and re-builds are now just a couple of seconds, which I can live with.

exports.onCreateWebpackConfig = ({
  actions,
  getConfig,
  loaders,
  plugins,
  stage
}) => {
  const currentConfig = getConfig()

  currentConfig.module.rules = [
    ...currentConfig.module.rules.filter(
      rule => String(rule.test) !== String(/\.(js|mjs|jsx)$/)
    ),
    {
      ...loaders.js(),
      test: /\.(js|mjs|jsx)$/,
      exclude: /(node_modules|lib\/components)/
    }
  ]

  act…

Replies: 2 comments 14 replies

Comment options

You must be logged in to vote
10 replies
@tu4mo
Comment options

@tu4mo
Comment options

@KyleAMathews
Comment options

@tu4mo
Comment options

@tu4mo
Comment options

Comment options

You must be logged in to vote
4 replies
@tu4mo
Comment options

@KyleAMathews
Comment options

@tu4mo
Comment options

@KyleAMathews
Comment options

Answer selected by tu4mo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants