joeeames / WebpackFundamentalsCourse

272 stars 122 forks source link

Basic Builds With Webpack - Webpack config #2

Closed bitclaw closed 9 years ago

bitclaw commented 9 years ago

The regular expression in the loaders section should be wrapped in quotes for the newest webpack version (As of writing this ticket , it's currently version 1.12.2)

module.exports = {
  entry: ["./utils","./app.js"],
  output: {
    filename: "bundle.js"
  },
  module: {
    loaders: [
      {
       test: "/\.es6$",
       exclude: /node_modules/,
       loader: "babel-loader"
      }
    ]
  },
  resolve: {
    extensions: ['','.js', '.es6']
  },
  watch: true
}
bitclaw commented 9 years ago

Nevermind forgot to add trailing slash at the end of the regular expression:

module.exports = {
  entry: ["./utils","./app.js"],
  output: {
    filename: "bundle.js"
  },
  module: {
    loaders: [
      {
       test: /\.es6$/,
       exclude: /node_modules/,
       loader: "babel-loader"
      }
    ]
  },
  resolve: {
    extensions: ['','.js', '.es6']
  },
  watch: true
}