Добавление поддержки баннера

This commit is contained in:
2024-03-20 14:20:44 +04:00
parent a08d3c2e4e
commit 5ad296e61e
8 changed files with 119 additions and 74 deletions
+5 -35
View File
@@ -1,10 +1,8 @@
// Generated using webpack-cli https://github.com/webpack/webpack-cli
const path = require("path");
const webpack = require("webpack");
const BomPlugin = require("webpack-utf8-bom");
const { exec } = require("node:child_process");
const TerserPlugin = require("terser-webpack-plugin");
const { libBanner } = require("./webpack.banner");
const isProduction = process.env.NODE_ENV == "production";
@@ -16,19 +14,8 @@ const config = {
},
plugins: [
new BomPlugin(true),
{
apply: (compiler) => {
compiler.hooks.afterEmit.tap("AfterEmitPlugin", (compilation) => {
exec("./upload.sh", (err, stdout, stderr) => {
if (stdout) process.stdout.write(stdout);
if (stderr) process.stderr.write(stderr);
console.log("Uploaded.");
});
});
},
},
// Add your plugins here
// Learn more about plugins from https://webpack.js.org/configuration/plugins/
libBanner,
libUpload,
],
module: {
rules: [
@@ -45,8 +32,6 @@ const config = {
test: /\.html$/i,
loader: "html-loader",
},
// Add your rules for custom modules here
// Learn more about loaders from https://webpack.js.org/loaders/
],
},
resolve: {
@@ -64,6 +49,7 @@ const config = {
terserOptions: {
compress: true,
},
extractComments: false,
minify: TerserPlugin.uglifyJsMinify,
})],
},
@@ -76,20 +62,4 @@ module.exports = () => {
config.mode = "development";
}
return config;
};
/*
{
"compilerOptions": {
"module": "AMD",
"lib": ["es2017", "dom"],
"rootDir": "./src/",
"outFile": "dist/april-fools.js",
"moduleResolution": "nodenext",
"esModuleInterop": true
},
"files": [
"src/main.ts"
]
}
*/
};