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.

babelrc: false still reads .babelrc file

See original GitHub issue

I’m submitting a bug report

Webpack Version: 2.2.1

Babel Core Version: ~5.24.0~ 6.24.0

Babel Loader Version: 6.4.0

Please tell us about your environment: maxOS 10.12.3

Current behavior: When using babelrc: false, babel-loader still reads from babelrc file

Expected/desired behavior: Should not read from babelrc file

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem along with a gist/jsbin of your webpack configuration. https://gist.github.com/hulkish/5d225beda0fc6cc1c1332befc00f0edf

  • What is the expected behavior? (per the example) react-hot-loader/babel should not be included in bundle. However, it indeed does show up.

  • What is the motivation / use case for changing the behavior? babelrc: false should completely ignore all .babelrc files

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
shahankitcommented, Aug 28, 2017

@hulkish I’m having same issue. I’m having similar webpack config file and want to skip babelrc and rather use the config set in webpack file.

module: {
  loaders: [
    {
      test: /\.js$/,
      loader: 'babel-loader',
      include: path.join(__dirname, 'app'),
      options: {
        babelrc: false,
        presets: ['react', 'es2015', 'stage-0'],
        plugins: ['babel-plugin-transform-decorators-legacy']
      }
    },
    {
      test: /\.css$/,
      loaders: ['style-loader','css-loader','postcss-loader']
    },
    {
      include: /\.json$/,
      loaders: ["json-loader"]
    }
  ]
},
0reactions
loganfsmythcommented, Sep 11, 2018

It would be best to create a reproducible example repository and file a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

webpack - .babelrc file is not applied - Stack Overflow
When I read the official documentation, I understood that babel-loader automatically recognizes and applies the .babelrc file. Am I wrong?
Read more >
Config Files - Babel.js
Configuration File Types. ... how to configure monorepos that have many packages. File-relative configs can also be disabled by setting "babelrc" to false...
Read more >
Configure Babel
Create a file called babel.config.json with the following content at the root of your project (where the package.json is). ... Check out the...
Read more >
Options - Babel.js
babelrc files are loaded relative to the file being compiled. If this option is omitted, Babel will behave as if babelrc: false has...
Read more >
babel/preset-env
For example, to only include polyfills and code transforms needed for users whose browsers have >0.25% ... Setting this to false will preserve...
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