Files
ESP3D-WEBUI/extensions/click2go/webpack.config.js
Luc f77d421e86 Fix click2go not displaying toast when saving settings due to typo
rename repository of clicktogo as click2go as the extension name
remove click2go console.log now is finalized
bump click2go version to 1.0.1 and build package
Remove auto toast messages in extensions API because it is extensions to handle toast on failure / success
Bump webui version and build packages
2024-06-23 07:28:45 +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 = 'click2go.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'],
},
},
}),
],
};