2024-06-11 00:48:44 +00:00
|
|
|
const assproc = require('@railcomm/assproc');
|
|
|
|
const { join: pathJoin } = require('path');
|
2023-07-17 14:37:39 +00:00
|
|
|
const fs = require('fs');
|
|
|
|
|
|
|
|
(async () => {
|
2024-06-11 00:48:44 +00:00
|
|
|
const isDebug = fs.existsSync(pathJoin(__dirname, '.debug'));
|
|
|
|
|
|
|
|
const env = {
|
|
|
|
root: __dirname,
|
|
|
|
source: pathJoin(__dirname, 'assets'),
|
|
|
|
public: pathJoin(__dirname, 'public'),
|
|
|
|
debug: isDebug,
|
|
|
|
swc: {
|
|
|
|
es: 'es2021',
|
|
|
|
},
|
|
|
|
};
|
2024-01-24 18:24:40 +00:00
|
|
|
|
2024-06-11 00:48:44 +00:00
|
|
|
const tasks = {
|
|
|
|
js: [
|
|
|
|
{ source: 'misuzu.js', target: '/assets', name: 'misuzu.{hash}.js', },
|
|
|
|
],
|
|
|
|
css: [
|
|
|
|
{ source: 'misuzu.css', target: '/assets', name: 'misuzu.{hash}.css', },
|
|
|
|
],
|
|
|
|
};
|
2024-01-24 18:24:40 +00:00
|
|
|
|
2024-06-11 00:48:44 +00:00
|
|
|
const files = await assproc.process(env, tasks);
|
2023-07-17 14:37:39 +00:00
|
|
|
|
2024-06-11 00:48:44 +00:00
|
|
|
fs.writeFileSync(pathJoin(__dirname, 'assets/current.json'), JSON.stringify(files));
|
2023-07-17 14:37:39 +00:00
|
|
|
})();
|