Skip to content

Commit

Permalink
rollup adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Oct 16, 2023
1 parent 04a040a commit eddb8cc
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion config/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ 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 All @@ -63,7 +72,7 @@ function prepareCJS(input, output) {
exports: "named",
externalLiveBindings: false,
},
plugins: [nodeResolve()],
plugins: [nodeResolve(), removeComments],
};
}

Expand All @@ -79,6 +88,9 @@ function prepareCJSMinified(input) {
mangle: {
toplevel: true,
},
format: {
comments: "some", // keeps comments with a @license, @copyright or @preserve tag
},
compress: {
toplevel: true,
global_defs: {
Expand Down Expand Up @@ -111,6 +123,7 @@ function prepareBundle({
externalLiveBindings: false,
},
plugins: [
removeComments,
{
name: "externalize-dependency",
resolveId(id, parentId) {
Expand Down

0 comments on commit eddb8cc

Please sign in to comment.