Here is the snapshot of a part of my script after compiling:
I don't understand that why doesn't it convert new.target
to this.constructor
?
Example:
class IList {
constructor() {
console.log('compare using new.target:', new.target === IList);
console.log('compare using this.constructor:', this.constructor === IList);
}
}
new IList();
I want it does that because I can use this.constructor
in the browsers which don't support for es6 while new.target
requires.
Should I report it to webpack team?
UPDATE:
webpack.config.js
:
let webpack = require('webpack'),
path = require('path'),
BabiliPlugin = require("babili-webpack-plugin");
module.exports = {
entry: {
'site': './assets/js/site',
'site.min': './assets/js/site'
},
output: {
publicPath: '/js/',
path: path.join(__dirname, '/wwwroot/js/'),
filename: '[name].js'
},
module: {
loaders: [
{
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015', 'stage-1']
}
}
]
},
plugins: [
new BabiliPlugin({}, {
test: /\.min\.js$/
}),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery'
})
]
};