Is the webpack configuration file ES6 written?

  node.js, question

I have studied it for a while, but it is still wrong to follow it. Please give me your advice.

// file: webpack.config.babel.js
 import path from 'path';
 
 export default {
 entry: './src/index.js',
 
 output: {
 path: path.resolve(__dirname, 'build'),
 filename: 'bundle.js'
 },
 
 module: {
 loaders: [
 {test: /\.js$/, loader: 'babel'}
 bracket
 bracket
 bracket
//file: package.json
{
  "name": "demo",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "start": "webpack-dev-server --devtool eval --progress --colors --inline --hot --content-base build",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "dependencies": {
    "history": "^1.17.0",
    "react": "^0.14.5",
    "react-dom": "^0.14.5",
    "react-router": "^1.0.3"
  },
  "devDependencies": {
    "babel-core": "^6.3.26",
    "babel-loader": "^6.2.0",
    "webpack": "^1.12.9",
    "webpack-dev-server": "^1.14.0"
  }
}
  1. npm install babel-preset-es2015 --save-dev

  2. Inwebpack.config.jsTo create a file in the same directory as.babelrc, which reads as follows

bracket
 "presets": ["es2015"]
 bracket