Skip to content
Permalink
Browse files

configure webpack to use babel-loader

Babel configs are now placed in webpack.config.js
  • Loading branch information...
nicoqh committed Jun 3, 2019
1 parent 10efe7e commit 1434a09626af98edc9788a531e4315238fd2a426
Showing with 36 additions and 21 deletions.
  1. +0 −21 babel.config.js
  2. +36 −0 webpack.config.js

This file was deleted.

@@ -28,4 +28,40 @@ module.exports = {
path: PATH_DIST,
filename: 'js/[name].[hash].js',
},

// Determine how the different types of modules will be treated.
// https://webpack.js.org/configuration/module
// https://webpack.js.org/concepts#loaders
module: {
rules: [
{
test: /\.js$/, // Apply this rule to files ending in .js
exclude: /node_modules/, // Don't apply to files residing in node_modules
use: { // Use the following loader and options
loader: 'babel-loader',
// We can pass options to both babel-loader and Babel. This option object
// will replace babel.config.js
options: {
presets: [
['@babel/preset-env', {
debug: true, // Output the targets/plugins used when compiling

// Configure how @babel/preset-env handles polyfills from core-js.
// https://babeljs.io/docs/en/babel-preset-env
useBuiltIns: 'usage',

// Specify the core-js version. Must match the version in package.json
corejs: 3,

// Specify which environments we support/target for our project.
// (We have chosen to specify targets in .browserslistrc, so there
// is no need to do it here.)
// targets: "",
}],
],
},
}
}
],
},
};

0 comments on commit 1434a09

Please sign in to comment.
You can’t perform that action at this time.