mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 14:30:02 -04:00
fix: use real package version in errortemplate
This commit is contained in:
parent
9305fdd96a
commit
b9d60e96e2
2 changed files with 15 additions and 14 deletions
|
@ -1,12 +1,14 @@
|
|||
import { defineConfig } from "@rspack/cli";
|
||||
import { rspack } from "@rspack/core";
|
||||
import { RsdoctorRspackPlugin } from "@rsdoctor/rspack-plugin";
|
||||
import { join } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import obfuscator from "javascript-obfuscator";
|
||||
const { obfuscate } = obfuscator;
|
||||
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { join } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
const __dirname = fileURLToPath(new URL(".", import.meta.url));
|
||||
const packagemeta = JSON.parse(await readFile("package.json"));
|
||||
|
||||
export default defineConfig({
|
||||
// change to production when needed
|
||||
|
@ -66,6 +68,9 @@ export default defineConfig({
|
|||
new rspack.ProvidePlugin({
|
||||
dbg: [join(__dirname, "src/log.ts"), "default"],
|
||||
}),
|
||||
new rspack.DefinePlugin({
|
||||
VERSION: JSON.stringify(packagemeta.version),
|
||||
}),
|
||||
process.env.OBFUSCATE === "true" && {
|
||||
apply(compiler) {
|
||||
compiler.hooks.compilation.tap("GyatPlugin", (compilation) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue