I have this code:
\"use strict\";
import browserSync from \"browser-sync\";
import httpProxy from \"http-proxy\";
let proxy = httpProxy.createProxyServer({
First ensure you have the following node modules
:
npm i -D webpack babel-core babel-preset-es2015 babel-preset-stage-2 babel-loader
Next, add this to your Webpack config file (webpack.config.js
) :
// webpack.config.js
...
module : {
loaders : [
{
test : /\.js$/,
loader : 'babel',
exclude : /node_modules/,
options : {
presets : [ 'es2015', 'stage-2' ] // stage-2 if required
}
}
]
}
...
References:
Good Luck!