When I try to run my application using webpack with es2017, I get the following error:
ERROR in ./app/app.js
Module not found: Error: Cannot resolve module 'babel-preset-es2017/polyfill' in C:\Users\mjarn\WebstormProjects\zombie-cat-production\app
@ ./app/app.js 3:0-39
My webpack setup:
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/,
include: __dirname,
query: {
presets: ['es2015', 'es2017', 'react'],
plugins: ['transform-runtime', 'transform-decorators-legacy', 'transform-class-properties'],
}
}
]
}
Import file input operations:
import 'babel-preset-es2017/polyfill'
import React from 'react'
import ReactDOM from 'react-dom'
...
How can I make it work?
source
share