mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-03-26 12:14:35 -05:00
91 lines
2.1 KiB
JavaScript
91 lines
2.1 KiB
JavaScript
import path from 'path';
|
|
|
|
import typescript from '@rollup/plugin-typescript';
|
|
import commonjs from '@rollup/plugin-commonjs';
|
|
import alias from '@rollup/plugin-alias';
|
|
import nodeResolve from '@rollup/plugin-node-resolve';
|
|
import nodePolyfill from 'rollup-plugin-polyfill-node';
|
|
import html from '@rollup/plugin-html';
|
|
|
|
const preload = {
|
|
input: 'src/app/preload/index.ts',
|
|
output: {
|
|
file: 'dist/app/bundle/preload.cjs',
|
|
format: 'cjs',
|
|
},
|
|
plugins: [
|
|
typescript({
|
|
noEmit: true,
|
|
declaration: false,
|
|
}),
|
|
commonjs({
|
|
// the ".ts" extension is required
|
|
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
esmExternals: true,
|
|
}),
|
|
],
|
|
external: [
|
|
'electron',
|
|
],
|
|
};
|
|
|
|
const preload_webservice = {
|
|
input: 'src/app/preload-webservice/index.ts',
|
|
output: {
|
|
file: 'dist/app/bundle/preload-webservice.cjs',
|
|
format: 'cjs',
|
|
},
|
|
plugins: [
|
|
typescript({
|
|
noEmit: true,
|
|
declaration: false,
|
|
}),
|
|
commonjs({
|
|
// the ".ts" extension is required
|
|
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
esmExternals: true,
|
|
}),
|
|
],
|
|
external: [
|
|
'electron',
|
|
],
|
|
};
|
|
|
|
const browser = {
|
|
input: 'src/app/browser/index.ts',
|
|
output: {
|
|
file: 'dist/app/bundle/browser.js',
|
|
format: 'es',
|
|
},
|
|
plugins: [
|
|
html({
|
|
title: 'nxapi',
|
|
}),
|
|
typescript({
|
|
noEmit: true,
|
|
declaration: false,
|
|
}),
|
|
commonjs({
|
|
// the ".ts" extension is required
|
|
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
esmExternals: true,
|
|
}),
|
|
nodePolyfill(),
|
|
alias({
|
|
entries: [
|
|
{find: 'react-native', replacement: path.resolve(__dirname, 'node_modules', 'react-native-web')},
|
|
],
|
|
}),
|
|
nodeResolve({
|
|
browser: true,
|
|
preferBuiltins: false,
|
|
}),
|
|
],
|
|
};
|
|
|
|
export default [
|
|
preload,
|
|
preload_webservice,
|
|
browser,
|
|
];
|