Skip to content

Commit f4cd508

Browse files
committed
use rollup-plugin-cleanup
1 parent eddb8cc commit f4cd508

File tree

3 files changed

+84
-9
lines changed

3 files changed

+84
-9
lines changed

config/rollup.config.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ import { promises as fs } from "fs";
33

44
import nodeResolve from "@rollup/plugin-node-resolve";
55
import { terser as minify } from "rollup-plugin-terser";
6+
import cleanup from "rollup-plugin-cleanup";
67

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

11+
const removeComments = cleanup({});
12+
1013
function isExternal(id, parentId, entryPointsAreExternal = true) {
1114
let posixId = toPosixPath(id);
1215
const posixParentId = toPosixPath(parentId);
@@ -50,15 +53,6 @@ function toPosixPath(p) {
5053
return p;
5154
}
5255

53-
const removeComments = minify({
54-
compress: false,
55-
mangle: false,
56-
toplevel: false,
57-
format: {
58-
comments: "some", // keeps comments with a @license, @copyright or @preserve tag
59-
},
60-
});
61-
6256
function prepareCJS(input, output) {
6357
return {
6458
input,

package-lock.json

+80
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@
162162
"resolve": "1.22.6",
163163
"rimraf": "5.0.1",
164164
"rollup": "2.79.1",
165+
"rollup-plugin-cleanup": "3.2.1",
165166
"rollup-plugin-terser": "7.0.2",
166167
"rxjs": "7.8.1",
167168
"size-limit": "8.2.6",

0 commit comments

Comments
 (0)