Thursday 4 May 2017

Webpack Babel-loader - not supported in a preset

I have been trying to solve the following error for the past 2 days but to no avail: enter image description here

I tried playing around with the .babelrc file and subsequently decided to include the presets in the webpack config file itself. The following is my babel-loader configuration in webpack.config.js.

rules: [
    {
      test: /\.js$/,
      exclude: /node_modules/,
      use: [
        {
          loader: 'babel-loader',
          options: {
            babelrc: false,
            cacheDirectory: true,
            presets: ["react", "es2015", "stage-0"]
          },
        },
        {
          loader: 'eslint-loader',
        }
      ],
    }
  ]

The following is my package.json info:

  "dependencies": {
    "babel-core": "7.0.0-alpha.9",
    "babel-loader": "7.0.0",
    "babel-polyfill": "7.0.0-alpha.9",
    "babel-preset-es2015": "6.24.1",
    "babel-preset-react": "6.24.1",
    "babel-preset-stage-0": "6.24.1",
    "babel-register": "6.24.1",
    "webpack": "2.4.1",
    "webpack-chunk-hash": "0.4.0",
    "webpack-dev-middleware": "1.10.2",
    "webpack-dev-server": "1.14.1",
    "webpack-hot-middleware": "2.18.0",
   }

If any light could be shed on what's causing this error, it would be highly appreciated.



via Rads

No comments:

Post a Comment