mirror of
https://github.com/bakhirev/assayo.git
synced 2024-11-16 16:21:41 +00:00
18 lines
605 B
JavaScript
18 lines
605 B
JavaScript
|
const fs = require('node:fs');
|
||
|
const { exec } = require('node:child_process');
|
||
|
|
||
|
exec([
|
||
|
'mv ../build/static/js/main.*.js ../build/static/index.js',
|
||
|
'rm -rf ../build/static/js',
|
||
|
'mv ../build/static/css/main.*.css ../build/static/index.css',
|
||
|
'rm -rf ../build/static/css',
|
||
|
'rm ../build/asset-manifest.json',
|
||
|
'rm ../build/test.txt',
|
||
|
].join(' && '));
|
||
|
|
||
|
const html = fs.readFileSync('../build/index.html', 'utf8');
|
||
|
const text = html
|
||
|
.replace(/static\/js\/[a-z0-9.]+/gim, 'static/index.js')
|
||
|
.replace(/static\/css\/[a-z0-9.]+/gim, 'static/index.css');
|
||
|
fs.writeFileSync('../build/index.html', text);
|