You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import pkjs from "./package.json";
|
|
|
|
import { defineConfig } from "rollup";
|
|
|
|
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
|
|
|
import alias from "@rollup/plugin-alias";
|
|
|
|
import { swc } from "rollup-plugin-swc3";
|
|
|
|
import { resolve as resolvePath } from "path";
|
|
|
|
const projectRootDir = resolvePath(__dirname);
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
input: pkjs.main,
|
|
|
|
output: {
|
|
|
|
file: "dist/build.js",
|
|
|
|
format: "iife",
|
|
|
|
},
|
|
|
|
external: ["React"],
|
|
|
|
plugins: [
|
|
|
|
alias({
|
|
|
|
entries: [
|
|
|
|
{ find: "nests", replacement: resolvePath(projectRootDir, "node_modules/nests/esm/") },
|
|
|
|
{ find: "react", replacement: resolvePath(projectRootDir, "src/shim_react.js") }
|
|
|
|
],
|
|
|
|
}),
|
|
|
|
nodeResolve(),
|
|
|
|
swc({
|
|
|
|
jsc: {
|
|
|
|
minify: {
|
|
|
|
"compress": true
|
|
|
|
},
|
|
|
|
parser: {
|
|
|
|
"syntax": "ecmascript",
|
|
|
|
"jsx": true
|
|
|
|
},
|
|
|
|
"target": "es2022",
|
|
|
|
"baseUrl": "./src"
|
|
|
|
}
|
|
|
|
})
|
|
|
|
],
|
|
|
|
});
|