Files
fonticon/webpack.config.js

44 lines
875 B
JavaScript

const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
mode: 'development',
entry: { index: './src/js/index.js', ga: './src/js/lib/ga.js' },
output: {
filename: '[name].js',
},
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
}),
new HtmlWebpackPlugin({
template: './src/html/index.html',
}),
],
devServer: {
static: 'dist',
},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.(png|jpg|gif)$/,
type: 'asset/resource',
},
],
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
},
stats: {
modules: true,
},
};