mCaptcha/webpack.config.js

49 lines
1.1 KiB
JavaScript
Raw Normal View History

'use strict';
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
module.exports = {
devtool: 'inline-source-map',
mode: 'development',
entry: './templates/index.ts',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, './static-assets/bundle/'),
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
},
{
test: /\.s[ac]ss$/i,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
{
loader: 'sass-loader',
options: {
implementation: require('dart-sass'),
},
},
],
},
],
},
resolve: {
extensions: ['.ts', '.tsx', '.js'],
},
plugins: [new MiniCssExtractPlugin()],
optimization: {
minimizer: [
// For webpack@5 you can use the `...` syntax to extend existing minimizers (i.e. `terser-webpack-plugin`), uncomment the next line
`...`,
new CssMinimizerPlugin(),
],
},
};