Mixonomer/webpack.common.js

36 lines
845 B
JavaScript
Raw Normal View History

const path = require('path');
const webpack = require('webpack');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
module.exports = {
entry: {
app: './src/js/app.js',
2019-08-03 21:35:08 +01:00
login: './src/js/login.js',
register: './src/js/register.js'
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /(node_modules|bower_components)/,
loader: "babel-loader",
options: { presets: ["@babel/env"] }
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
}
]
},
plugins: [
new CleanWebpackPlugin()
],
resolve: { extensions: ["*", ".js", ".jsx"] },
output: {
2020-01-26 20:33:09 +00:00
filename: '[name].bundle.js',
chunkFilename: 'chunk-[name].bundle.js',
2020-01-26 20:33:09 +00:00
path: path.resolve(__dirname, 'build/js'),
publicPath: '/build/js/'
}
};