Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Commit

Permalink
fix: add rollup-plugin-terser for minifying bundle files (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjchender authored Feb 3, 2020
1 parent 8ccf01b commit 4bdaa9e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"Andyyou <[email protected]> (http://andyyou.github.io/)"
],
"license": "MIT",
"main": "dist/react-use-opentok.cjs.js",
"module": "dist/react-use-opentok.esm.js",
"main": "dist/react-use-opentok.cjs.min.js",
"module": "dist/react-use-opentok.esm.min.js",
"engines": {
"node": ">=8",
"npm": ">=5"
Expand Down Expand Up @@ -83,6 +83,7 @@
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-peer-deps-external": "^2.2.0",
"rollup-plugin-terser": "^5.2.0",
"rollup-plugin-url": "^3.0.1",
"semantic-release": "^17.0.1",
"typescript": "^3.7.5"
Expand Down
9 changes: 9 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ import external from 'rollup-plugin-peer-deps-external';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import url from '@rollup/plugin-url';
import { terser } from 'rollup-plugin-terser';

import pkg from './package.json';

export default {
input: 'src/index.js',
output: [
{
file: pkg.main.replace('.min', ''),
format: 'cjs',
sourcemap: true,
},
{
file: pkg.main,
format: 'cjs',
Expand All @@ -27,5 +33,8 @@ export default {
babel(),
resolve(),
commonjs(),
terser({
include: [/^.+\.min\.js$/],
}), // minify bundle files
],
};

0 comments on commit 4bdaa9e

Please sign in to comment.