Skip to content

Commit

Permalink
Chore/use rollup terser (mui#1028)
Browse files Browse the repository at this point in the history
* Update packages

* Fix rollup errors, enable umd bundle

* Remove unused deps from lib/package.json

* Use rollup-plugin-terser instead of uglify
  • Loading branch information
dmtrKovalenko authored May 6, 2019
1 parent 5be8ca2 commit 269329d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 22 deletions.
3 changes: 2 additions & 1 deletion docs/tsconfig.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"noEmit": true,
"strict": true,
"baseUrl": ".",
"noImplicitAny": false
"noImplicitAny": false,
"resolveJsonModule": true
},
"include": ["./typings.d.ts", "./pages/**/*.jsx"]
}
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-node-resolve": "^4.0.1",
"rollup-plugin-size-snapshot": "^0.8.0",
"rollup-plugin-terser": "^4.0.4",
"rollup-plugin-typescript": "^1.0.0",
"rollup-plugin-uglify": "^6.0.2",
"size-limit": "^0.21.1",
"ts-jest": "^24.0.1",
"ts-lib": "0.0.5",
Expand Down
5 changes: 3 additions & 2 deletions lib/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import path from 'path';
// @ts-ignore
import pkg from './package.json';
import typescript from 'typescript';
import babel from 'rollup-plugin-babel';
import replace from 'rollup-plugin-replace';
import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve';
import typescriptPlugin from 'rollup-plugin-typescript';
import { uglify } from 'rollup-plugin-uglify';
import { terser } from 'rollup-plugin-terser';
import { sizeSnapshot } from 'rollup-plugin-size-snapshot';

const tsconfig = path.join(__dirname, 'tsconfig.json');
Expand Down Expand Up @@ -131,7 +132,7 @@ export default [
commonjs(commonjsOptions),
replace({ 'process.env.NODE_ENV': JSON.stringify('production') }),
sizeSnapshot(),
uglify(),
terser(),
],
},
];
28 changes: 10 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9726,6 +9726,16 @@ rollup-plugin-size-snapshot@^0.8.0:
terser "^3.14.1"
webpack "^4.28.4"

rollup-plugin-terser@^4.0.4:
version "4.0.4"
resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-4.0.4.tgz#6f661ef284fa7c27963d242601691dc3d23f994e"
integrity sha512-wPANT5XKVJJ8RDUN0+wIr7UPd0lIXBo4UdJ59VmlPCtlFsE20AM+14pe+tk7YunCsWEiuzkDBY3QIkSCjtrPXg==
dependencies:
"@babel/code-frame" "^7.0.0"
jest-worker "^24.0.0"
serialize-javascript "^1.6.1"
terser "^3.14.1"

rollup-plugin-typescript@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/rollup-plugin-typescript/-/rollup-plugin-typescript-1.0.1.tgz#86565033b714c3d1f3aba510aad3dc519f7091e9"
Expand All @@ -9734,16 +9744,6 @@ rollup-plugin-typescript@^1.0.0:
resolve "^1.10.0"
rollup-pluginutils "^2.5.0"

rollup-plugin-uglify@^6.0.2:
version "6.0.2"
resolved "https://registry.yarnpkg.com/rollup-plugin-uglify/-/rollup-plugin-uglify-6.0.2.tgz#681042cfdf7ea4e514971946344e1a95bc2772fe"
integrity sha512-qwz2Tryspn5QGtPUowq5oumKSxANKdrnfz7C0jm4lKxvRDsNe/hSGsB9FntUul7UeC4TsZEWKErVgE1qWSO0gw==
dependencies:
"@babel/code-frame" "^7.0.0"
jest-worker "^24.0.0"
serialize-javascript "^1.6.1"
uglify-js "^3.4.9"

rollup-pluginutils@^2.0.1, rollup-pluginutils@^2.3.0:
version "2.4.1"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.4.1.tgz#de43ab54965bbf47843599a7f3adceb723de38db"
Expand Down Expand Up @@ -10930,14 +10930,6 @@ uglify-js@^3.1.4:
commander "~2.20.0"
source-map "~0.6.1"

uglify-js@^3.4.9:
version "3.4.9"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.9.tgz#af02f180c1207d76432e473ed24a28f4a782bae3"
integrity sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==
dependencies:
commander "~2.17.1"
source-map "~0.6.1"

[email protected]:
version "4.1.0"
resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.1.0.tgz#6ec2dd0de887e58a4dee83a050ded80ffc4137db"
Expand Down

0 comments on commit 269329d

Please sign in to comment.