H
H
heIIfire2017-09-12 10:52:20
JavaScript
heIIfire, 2017-09-12 10:52:20

Why is babel-loader not working?

bundle.js is successfully created, but Babel's loader doesn't work for some reason. Here is the webpack config

module.exports = {
    entry: './src/index.js',
    output: {
        path: __dirname + '/src',
        filename: 'build.js'
    },
    watch: true,
    module: {
       loaders:[{
           test: /\.js$/,
           loader: 'babel-loader'
       }]
    }
};

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Petelin, 2017-09-12
@heIIfire

loaders: [
          {
              test: /\.js$/,
              loader: 'babel-loader',
              exclude: [/node_modules/],
              query: {
                  presets: ['es2015', 'react']
              }
          }
]

Can specify and install presets

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question