3dexperiments/webpack.config.js

31 lines
670 B
JavaScript
Raw Normal View History

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']
}
}
}
2019-02-12 10:03:18 +00:00
]
},
devtool: env.mode === 'development' ? 'inline-source-map' : '',
plugins: [
new HtmlWebpackPlugin({ template: 'index.html' })
]
2019-02-12 10:03:18 +00:00
}
}