Share .env file with the NodeJS build script.

This commit is contained in:
flash 2025-04-11 18:02:38 +00:00
parent 35dce01323
commit 99e3e3111a
Signed by: flash
GPG key ID: 2C9C2C574D47FE3E
7 changed files with 88 additions and 84 deletions

View file

@ -3,21 +3,13 @@ const { join: pathJoin } = require('path');
const fs = require('fs');
(async () => {
const isDebug = fs.existsSync(pathJoin(__dirname, '.debug'));
const env = {
root: __dirname,
source: pathJoin(__dirname, 'assets'),
public: pathJoin(__dirname, 'public'),
debug: isDebug,
swc: {
es: 'es2021',
jsx: '$element',
jsxf: '$fragment',
},
housekeep: [
pathJoin(__dirname, 'public', 'assets'),
],
debug: !!process.env.MSZ_DEBUG,
swc: { es: 'es2021' },
housekeep: [ pathJoin(__dirname, 'public', 'assets') ],
};
const tasks = {
@ -51,5 +43,8 @@ const fs = require('fs');
const files = await assproc.process(env, tasks);
fs.writeFileSync(pathJoin(__dirname, 'assets/current.json'), JSON.stringify(files));
fs.writeFileSync(
pathJoin(__dirname, 'assets/current.json'),
JSON.stringify(files),
);
})();