B
B
BonBon Slick2020-12-31 18:14:08
JavaScript
BonBon Slick, 2020-12-31 18:14:08

How can I tell if .babelrc is being used?

Configs are named like this
webpack.config.dev.js
babelrc - common for everyone as I understand it

{
  "presets": [
    [
      "env",
      {
        "modules": false,
        "targets": {
          "browsers": [
            "> 1%",
            "last 2 versions",
            "not ie <= 8"
          ]
        }
      }
    ],
    "stage-2"
  ],
  "plugins": [
    "transform-runtime"
  ],
  "comments": false,
  "env": {
    "test": {
      "presets": [
        "es2015",
        "env",
        "stage-2"
      ],
      "plugins": [
        "istanbul"
      ]
    }
  }
}

Only I have suspicions that .babelrc is not used, how to check it?
Somewhere I saw in issues that webpack.bable.js is needed to run. Will it work if called
webpack.babel.dev.js 
webpack.babel.test.js 
webpack.babel.prod.js

?
And is it possible to set up different .babelrc for different webpack config?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BonBon Slick, 2020-01-21
@BonBonSlick

{
        test:    /\.js$/,
        // use:     'babel-loader',
        use:     'source-map-loader',
        exclude: /node_modules/,
      },

That's how to find out.
Babel was not used.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question