mcf-webapp-starter/webpack.common.js

42 lines
1.1 KiB
JavaScript
Raw Normal View History

2021-09-09 17:04:57 +01:00
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
entry: './src/index.js',
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'dist'),
// library: 'smartClientSocket',
// libraryTarget: 'umd'
},
plugins: [
new HtmlWebpackPlugin({
template: './src/index.html',
filename: path.resolve(__dirname, 'dist', 'index.html'),
}),
new MiniCssExtractPlugin({
filename: '[name].css',
chunkFilename: '[id].css',
}),
],
module: {
rules: [{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
},
},
{
test: /\.css$/,
use: [{
loader: MiniCssExtractPlugin.loader,
},
'css-loader',
],
},
],
},
};