* feat tracker moving redux stuff to worker thread * feat ui: sync redux messages to action time * feat ui: starting new redux ui * fix backend mob gen * feat tracker moving redux stuff to worker thread * feat ui: sync redux messages to action time * feat ui: starting new redux ui * fix backend mob gen * styles, third party etc * rm dead code * design fixes * wrapper around old redux stuff * prettier * icon sw * some changes to default style * some code style fixes
30 lines
827 B
JavaScript
30 lines
827 B
JavaScript
const { promises: fs } = require('fs');
|
|
const replaceInFiles = require('replace-in-files');
|
|
|
|
async function main() {
|
|
const webworker = await fs.readFile('build/webworker.js', 'utf8');
|
|
await replaceInFiles({
|
|
files: 'cjs/**/*',
|
|
from: 'WEBWORKER_BODY',
|
|
to: webworker.replace(/'/g, "\\'").replace(/\n/g, ''),
|
|
});
|
|
await replaceInFiles({
|
|
files: 'lib/**/*',
|
|
from: 'WEBWORKER_BODY',
|
|
to: webworker.replace(/'/g, "\\'").replace(/\n/g, ''),
|
|
});
|
|
await fs.writeFile('cjs/package.json', `{ "type": "commonjs" }`);
|
|
await replaceInFiles({
|
|
files: 'cjs/*',
|
|
from: /\.\.\/common/g,
|
|
to: './common',
|
|
});
|
|
await replaceInFiles({
|
|
files: 'cjs/**/*',
|
|
from: /\.\.\/\.\.\/common/g,
|
|
to: '../common',
|
|
});
|
|
}
|
|
main()
|
|
.then(() => console.log('compiled'))
|
|
.catch(err => console.error(err));
|