openreplay/tracker/tracker-redux/script/compile.cjs
Delirium 5421aedfe6
move redux plugin hashing to worker thread, update redux panel look and style
* 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
2024-04-09 14:47:31 +02:00

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));