Closed primozs closed 7 years ago
Could you show your Webpack config?
I found the solution. This is now working if using webpack2 Important is to set babel modules false.
//.babelrc
{
"presets": [
["es2015", { "modules": false }]
],
"ignore": [
"/node_modules/"
]
}
// webpak config is the same
const path = require('path');
const ClosureCompilerPlugin = require('webpack-closure-compiler');
module.exports = {
entry: [
path.join(__dirname, 'app.js')
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'app.min.js'
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loaders: ['babel-loader']
}
]
},
plugins: [
new ClosureCompilerPlugin({
compiler: {
language_in: 'ECMASCRIPT6',
language_out: 'ECMASCRIPT5',
compilation_level: 'ADVANCED'
}
})
]
};
Nice! In Webpack 2 you could try it without Babel, since Closure Compiler transpiles ES6.
What do use as loader for js when not using babel? Interested as well
cheers