2021-07-25 13:57:47 -04:00
|
|
|
import alias from '@rollup/plugin-alias';
|
|
|
|
|
import { dirname, resolve } from 'path';
|
|
|
|
|
import { fileURLToPath } from 'url';
|
|
|
|
|
import tsconfig from './tsconfig.json';
|
|
|
|
|
|
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
|
|
|
|
|
|
|
|
const aliases = Object.entries(tsconfig.compilerOptions.paths).map(([name, [path]]) => {
|
|
|
|
|
return {
|
|
|
|
|
find: name,
|
|
|
|
|
replacement: resolve(__dirname, 'out', path) + '.js'
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const shared = {
|
|
|
|
|
plugins: [
|
|
|
|
|
alias({
|
|
|
|
|
entries: [
|
|
|
|
|
...aliases,
|
2021-07-26 00:18:21 -04:00
|
|
|
{
|
|
|
|
|
find: 'frigid',
|
|
|
|
|
replacement: resolve(__dirname, 'node_modules/frigid/out/index.js')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
find: 'node-ipc',
|
|
|
|
|
replacement: resolve(__dirname, 'node_modules/node-ipc/node-ipc.js')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
find: 'event-pubsub',
|
|
|
|
|
replacement: resolve(__dirname, 'node_modules/event-pubsub/index.js')
|
|
|
|
|
},
|
2021-07-25 13:57:47 -04:00
|
|
|
]
|
2021-07-26 00:18:21 -04:00
|
|
|
}),
|
2021-07-25 13:57:47 -04:00
|
|
|
],
|
|
|
|
|
watch: {
|
|
|
|
|
include: 'out/**/*'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default [
|
|
|
|
|
{
|
|
|
|
|
...shared,
|
|
|
|
|
input: './out/src/index.js',
|
|
|
|
|
output: {
|
2021-07-26 00:18:21 -04:00
|
|
|
file: 'bin/app.bundle.cjs',
|
|
|
|
|
format: 'cjs'
|
2021-07-25 13:57:47 -04:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
...shared,
|
|
|
|
|
input: './out/src/hot-index.js',
|
|
|
|
|
output: {
|
2021-07-26 00:18:21 -04:00
|
|
|
file: 'bin/ipc-tower.bundle.cjs',
|
|
|
|
|
format: 'cjs'
|
2021-07-25 13:57:47 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
];
|