Skip to content

Commit

Permalink
Remove unnecessary config.
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Evans committed Aug 4, 2020
1 parent 212a3a3 commit 103d72c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 42 deletions.
15 changes: 1 addition & 14 deletions rollup-modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@ import filesize from 'rollup-plugin-filesize';
import minifyHTML from 'rollup-plugin-minify-html-literals';
import copy from 'rollup-plugin-copy';

const terserConfig = {
output: {
comments: function (_, comment) {
const text = comment.value;
const type = comment.type;
if (type == 'comment2') {
// multiline comment
return /@preserve|@license|@cc_on/i.test(text);
}
},
},
};

const filesizeConfig = {
showGzippedSize: true,
showBrotliSize: false,
Expand Down Expand Up @@ -60,7 +47,7 @@ const config = {
};

if (process.env.NODE_ENV !== 'development') {
config.plugins.push(terser(terserConfig));
config.plugins.push(terser());
}

export default config;
17 changes: 3 additions & 14 deletions rollup-modnomod.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,6 @@ const babelConfig = {
},
};

const terserConfig = {
output: {
comments: function (_, comment) {
const text = comment.value;
const type = comment.type;
if (type == 'comment2') {
// multiline comment
return /@preserve|@license|@cc_on/i.test(text);
}
},
},
};

const minifyHTMLLiteralsConfig = {
options: {
minifyOptions: {
Expand Down Expand Up @@ -82,6 +69,7 @@ const configs = [
minifyHTML(minifyHTMLLiteralsConfig),
resolve()
],
preserveEntrySignatures: false,
},
// The main JavaScript bundle for older browsers that don't support
// JavaScript modules or ES2015+.
Expand All @@ -98,6 +86,7 @@ const configs = [
resolve(),
copy(copyConfig),
],
preserveEntrySignatures: false,
},
// Babel polyfills for older browsers that don't support ES2015+.
{
Expand All @@ -112,7 +101,7 @@ const configs = [

for (const config of configs) {
if (process.env.NODE_ENV !== 'development') {
config.plugins.push(terser(terserConfig));
config.plugins.push(terser());
}
config.plugins.push(filesize(filesizeConfig));
}
Expand Down
15 changes: 1 addition & 14 deletions rollup-universal.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,6 @@ const babelConfig = {
},
};

const terserConfig = {
output: {
comments: function (_, comment) {
const text = comment.value;
const type = comment.type;
if (type == 'comment2') {
// multiline comment
return /@preserve|@license|@cc_on/i.test(text);
}
},
},
};

const filesizeConfig = {
showGzippedSize: true,
showBrotliSize: false,
Expand Down Expand Up @@ -91,7 +78,7 @@ const configs = [

for (const config of configs) {
if (process.env.NODE_ENV !== 'development') {
config.plugins.push(terser(terserConfig));
config.plugins.push(terser());
}
config.plugins.push(filesize(filesizeConfig));
}
Expand Down

0 comments on commit 103d72c

Please sign in to comment.