Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit 4569a8b

Browse files
authored
Merge pull request #140 from geotrev/js/terser
Update rollup to use terser instead of uglify for minification
2 parents e35fe18 + ad64770 commit 4569a8b

File tree

4 files changed

+23
-34
lines changed

4 files changed

+23
-34
lines changed

package-lock.json

Lines changed: 13 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@
9696
"rollup": "^1.16.3",
9797
"rollup-plugin-babel": "^4.3.2",
9898
"rollup-plugin-node-resolve": "^5.2.0",
99+
"rollup-plugin-terser": "^5.1.1",
99100
"rollup-plugin-uglify": "^6.0.2",
100101
"sass-loader": "^7.1.0",
101102
"style-loader": "^0.23.1",
102103
"terser-webpack-plugin": "^1.3.0",
103104
"uglify-js": "^3.6.0",
104-
"uglifyjs-webpack-plugin": "^2.1.2",
105105
"webpack": "^4.35.0",
106106
"webpack-cli": "^3.3.0",
107107
"webpack-dev-server": "^3.7.2",

rollup.config.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { uglify } from "rollup-plugin-uglify"
1+
import { terser } from "rollup-plugin-terser"
22
import path from "path"
33
import resolve from "rollup-plugin-node-resolve"
44
import babel from "rollup-plugin-babel"
@@ -55,13 +55,14 @@ const umdMinOutput = Object.assign({}, umdOutput, {
5555
const umdMinPlugins = []
5656
umdMinPlugins.push(
5757
...plugins,
58-
uglify({
58+
terser({
5959
output: {
6060
comments: (_, comment) => {
61-
if (comment.type === "comment2") {
62-
return /@preserve|@license|@cc_on/i.test(comment.value)
61+
const { value, type } = comment
62+
63+
if (type === "comment2") {
64+
return /@preserve|@license|@cc_on/i.test(value)
6365
}
64-
return false
6566
},
6667
},
6768
mangle: { reserved: ["Undernet"] },
@@ -74,4 +75,4 @@ const umdMinBundle = {
7475
plugins: umdMinPlugins,
7576
}
7677

77-
module.exports = [umdBundle, umdMinBundle]
78+
export default [umdBundle, umdMinBundle]

src/scss/undernet.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
@import "config";
1010
@import "utilities/mixins";
1111

12-
// remove this reset if you are scoping!
12+
// .#{$scope} {
13+
// Reset within the scope is optional
1314
@import "utilities/reset";
1415

15-
// .#{$scope} {
1616
@import "utilities/classes";
1717

1818
@import "layout/grid";

0 commit comments

Comments
 (0)