Skip to content

Commit

Permalink
fix(): Preserve rsc directives in build.
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanCQ committed Dec 18, 2023
1 parent 9f58e1a commit db16547
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
45 changes: 45 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"rollup-plugin-dts": "^4.2.3",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-preserve-directives": "^0.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-scss": "^3.0.0",
"rollup-plugin-terser": "^7.0.2",
Expand Down
7 changes: 5 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
import typescript from "@rollup/plugin-typescript";
import copy from "rollup-plugin-copy";
import preserveDirectives from "rollup-plugin-preserve-directives";
import { terser } from "rollup-plugin-terser";

export default [
{
input: "index.ts",
output: [
{
dir: "dist/",
format: "esm",
// preserveModules: true,
preserveModules: true,
},
],
plugins: [
Expand All @@ -28,7 +30,8 @@ export default [
targets: [{ src: "./src/tokens.css", dest: "./dist" }],
}),
// Minify output.
terser(),
terser({ compress: { directives: false } }),
preserveDirectives(),
],
},
];

0 comments on commit db16547

Please sign in to comment.