You need to install the es2015
preset:
npm install babel-preset-es2015
and then configure babel-loader
:
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['es2015']
}
}
More Related Contents:
- babel-loader jsx SyntaxError: Unexpected token [duplicate]
- Getting Unexpected Token Export
- ES6 exporting/importing in index file
- How do I generate sourcemaps when using babel and webpack?
- Arrow Function syntax not working with webpack?
- Webpack babel 6 ES6 decorators
- Error: Missing class properties transform
- Importing CSS files in Isomorphic React Components
- Babel 7 – ReferenceError: regeneratorRuntime is not defined
- Path aliases for imports in WebStorm
- Import ES module in Next.js ERR_REQUIRE_ESM
- Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module ‘babel-preset-react’
- How to setup TypeScript + Babel + Webpack?
- How to correctly use ES6 “export default” with CommonJS “require”?
- Extending built-in natives in ES6 with Babel
- How to prevent moment.js from loading locales with webpack?
- Browserify, Babel 6, Gulp – Unexpected token on spread operator
- How to import image (.svg, .png ) in a React Component
- firebase.auth is not a function
- Syntax error – Support for the experimental syntax ‘decorators-legacy’ isn’t currently enabled
- What exactly is Hot Module Replacement in Webpack?
- `this` is undefined in Dev Tools when using arrow function
- How to publish a module written in ES6 to NPM?
- What is the defined execution order of ES6 imports?
- Can I use webpack to generate CSS and JS separately?
- Webpack not excluding node_modules
- “unexpected token import” in Nodejs5 and babel?
- HtmlWebpackPlugin injects relative path files which breaks when loading non-root website paths
- how to set up an inline svg with webpack
- What does this javascript syntax mean ? (0, _parseKey2.default)(something) [duplicate]