Skip to content

Commit

Permalink
use rollup-plugin-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Oct 16, 2023
1 parent eddb8cc commit f4cd508
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 9 deletions.
12 changes: 3 additions & 9 deletions config/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import { promises as fs } from "fs";

import nodeResolve from "@rollup/plugin-node-resolve";
import { terser as minify } from "rollup-plugin-terser";
import cleanup from "rollup-plugin-cleanup";

const entryPoints = require("./entryPoints");
const distDir = "./dist";

const removeComments = cleanup({});

function isExternal(id, parentId, entryPointsAreExternal = true) {
let posixId = toPosixPath(id);
const posixParentId = toPosixPath(parentId);
Expand Down Expand Up @@ -50,15 +53,6 @@ function toPosixPath(p) {
return p;
}

const removeComments = minify({
compress: false,
mangle: false,
toplevel: false,
format: {
comments: "some", // keeps comments with a @license, @copyright or @preserve tag
},
});

function prepareCJS(input, output) {
return {
input,
Expand Down
80 changes: 80 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 @@ -162,6 +162,7 @@
"resolve": "1.22.6",
"rimraf": "5.0.1",
"rollup": "2.79.1",
"rollup-plugin-cleanup": "3.2.1",
"rollup-plugin-terser": "7.0.2",
"rxjs": "7.8.1",
"size-limit": "8.2.6",
Expand Down

0 comments on commit f4cd508

Please sign in to comment.