Files
ESP3D-WEBUI/extensions/gcodeViewer/webpack.config.js
Luc 8f7e11b9e3 Add Sanity check for icon extension if not available
Add Circle/CheckCircle icons for menus
Add .menu-item-panel css to be sure mouse click is taken in account
Comment some logs
Add prettierrc for each extension
Add code base for gcodeViewer extension - WIP
2024-07-24 13:18:44 +08:00

55 lines
1.2 KiB
JavaScript

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CompressionPlugin = require('compression-webpack-plugin');
const FileManagerPlugin = require('filemanager-webpack-plugin');
const htmlFileName = 'gcodeViewer.html';
module.exports = {
entry: `./src/${htmlFileName}`,
output: {
path: path.resolve(__dirname, 'dist'),
},
module: {
rules: [
{
test: /\.html$/,
use: ['html-loader'],
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.js$/,
use: ['babel-loader'],
},
],
},
plugins: [
new HtmlWebpackPlugin({
template: `./src/${htmlFileName}`,
filename: htmlFileName,
minify: {
collapseWhitespace: true,
removeComments: true,
},
inject: false,
}),
new CompressionPlugin({
filename: '[path][base].gz',
algorithm: 'gzip',
test: /\.html$/,
threshold: 0,
minRatio: 1,
}),
new FileManagerPlugin({
events: {
onEnd: {
delete: [`dist/${htmlFileName}`, 'dist/main.js'],
},
},
}),
],
};