2018-11-25 17:44:32 +00:00
|
|
|
const path = require('path')
|
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
|
|
|
|
2019-02-12 10:03:18 +00:00
|
|
|
module.exports = (env) => {
|
|
|
|
return {
|
|
|
|
entry: './src/index.js',
|
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, 'dist'),
|
|
|
|
filename: 'app.js'
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
exclude: /(node_modules)/,
|
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
presets: ['@babel/preset-env']
|
|
|
|
}
|
2018-11-25 17:44:32 +00:00
|
|
|
}
|
|
|
|
}
|
2019-02-12 10:03:18 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
devtool: env.mode === 'development' ? 'inline-source-map' : '',
|
|
|
|
plugins: [
|
|
|
|
new HtmlWebpackPlugin({ template: 'index.html' })
|
2018-11-25 17:44:32 +00:00
|
|
|
]
|
2019-02-12 10:03:18 +00:00
|
|
|
}
|
2018-11-25 17:44:32 +00:00
|
|
|
}
|