eeg_nest/rollup.config.js

79 lines
2.1 KiB
JavaScript
Raw Normal View History

2023-05-06 11:57:46 +00:00
const nodeResolve = require("@rollup/plugin-node-resolve");
const common = require("@rollup/plugin-commonjs");
const babel = require("@rollup/plugin-babel");
const copy = require("rollup-plugin-copy");
module.exports = [
{
input: "ssr/index.js",
output: [
{
dir: "ssr/lib",
format: "cjs"
}
],
external: ["solid-js", "solid-js/web", "path", "express", "stream"],
plugins: [
nodeResolve({ preferBuiltins: true, exportConditions: ["solid", "node"] }),
babel({
babelHelpers: "bundled",
presets: [["solid", { generate: "ssr", hydratable: true }]]
}),
common()
],
preserveEntrySignatures: false
},
{
input: "shared/src/index.js",
output: [
{
dir: "ssr/public/js",
format: "cjs"
}
],
preserveEntrySignatures: false,
plugins: [
nodeResolve({ exportConditions: ["solid"] }),
babel({
babelHelpers: "bundled",
presets: [["solid", { generate: "dom", hydratable: true }]]
}),
common(),
copy({
targets: [
{
src: ["shared/static/*"],
dest: "ssr/public"
}
]
})
]
},
{
input: "src/app.tsx",
output: [
{
dir: "dist",
format: "cjs"
}
],
preserveEntrySignatures: false,
plugins: [
nodeResolve({ exportConditions: ["solid"] }),
babel({
babelHelpers: "bundled",
presets: [["solid", { generate: "dom", hydratable: true }]]
}),
common(),
copy({
targets: [
{
src: ["shared/static/*"],
dest: "ssr/public"
}
]
})
]
}
];