79 lines
2.1 KiB
JavaScript
79 lines
2.1 KiB
JavaScript
|
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"
|
||
|
}
|
||
|
]
|
||
|
})
|
||
|
]
|
||
|
}
|
||
|
];
|