Буквенный хаос

This commit is contained in:
2023-03-28 01:27:30 +04:00
parent 49edfdca66
commit 0ca319ae0f
7 changed files with 129 additions and 25 deletions
+13 -1
View File
@@ -3,6 +3,7 @@
const path = require("path");
const webpack = require("webpack");
const BomPlugin = require('webpack-utf8-bom');
const { exec } = require('node:child_process');
const isProduction = process.env.NODE_ENV == "production";
@@ -13,7 +14,18 @@ const config = {
filename: () => ('april-fools' + (isProduction ? '.min' : '') + '.js'),
},
plugins: [
new BomPlugin(true)
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/
],