mirror of
https://github.com/rottenwheel/moner.ooo.git
synced 2024-12-22 16:17:46 +00:00
Kumi
035da04bf8
Switched to non-minified Bootstrap CSS for improved readability during development. Updated Webpack MiniCssExtractPlugin filename pattern to handle multiple CSS outputs more gracefully. Enhanced PurgeCSSPlugin configuration by incorporating JS paths and limiting removal to specific Bootstrap classes to avoid issues with dynamic class usage.
39 lines
952 B
JavaScript
39 lines
952 B
JavaScript
'use strict'
|
|
|
|
const path = require('path');
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
const { PurgeCSSPlugin } = require("purgecss-webpack-plugin");
|
|
const glob = require('glob-all');
|
|
|
|
module.exports = {
|
|
mode: 'development',
|
|
entry: './src/js/main.js',
|
|
output: {
|
|
filename: 'main.js',
|
|
path: path.resolve(__dirname, 'js'),
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.css$/,
|
|
use: [
|
|
MiniCssExtractPlugin.loader,
|
|
'css-loader'
|
|
]
|
|
}
|
|
]
|
|
},
|
|
plugins: [
|
|
new MiniCssExtractPlugin({
|
|
filename: '../css/[name].css'
|
|
}),
|
|
new PurgeCSSPlugin({
|
|
paths: glob.sync([
|
|
path.join(__dirname, 'index.php'),
|
|
path.join(__dirname, 'src/js/**/*.js')
|
|
]),
|
|
only: ['bootstrap'],
|
|
safelist: ['tooltip', 'fade', 'show', 'bs-tooltip-top', 'tooltip-inner', 'tooltip-arrow', 'btn-equals', 'btn-arrow', 'alert', 'alert-warning']
|
|
})
|
|
]
|
|
};
|