catamphetamine / universal-webpack

Isomorphic Webpack: both on client and server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rule.use.map is not a function

pizzarob opened this issue · comments

/universal-webpack/source/loaders.js:147:22

throws the error rule.use.map is not a function

The following is valid configuration, but universal webpack is expecting an array

    {
      test: /(\.js|\.jsx)$/,
      exclude: /node_modules/,
      use: {
        loader: 'babel-loader',
        options: {
          presets: ['env', 'es2015', 'react', 'stage-2'],
        },
      },
    },

According to the official Webpack documentation your config is wrong
See use:
https://webpack.js.org/configuration/module/#rule-use