Try babel

This commit is contained in:
Tyler Long
2017-04-17 16:47:26 +08:00
parent 166acad749
commit 0ebf162673
3 changed files with 63 additions and 15 deletions

View File

@@ -11,6 +11,25 @@ export const webConfig = () => {
output: {
path: path.join(__dirname, './dist/'),
filename: '[name].js'
},
module: {
rules: [
{
test: /\.js$/,
use: {
loader: 'babel-loader',
options: {
presets: [
['env', {
'targets': {
'browsers': ['last 3 versions']
}
}]
]
}
}
}
]
}
}
}
@@ -26,6 +45,25 @@ export const nodeConfig = () => {
path: path.join(__dirname, './dist/'),
filename: '[name].js',
libraryTarget: 'commonjs2'
},
module: {
rules: [
{
test: /\.js$/,
use: {
loader: 'babel-loader',
options: {
presets: [
['env', {
'targets': {
'node': 4.2
}
}]
]
}
}
}
]
}
}
}