Skip to content

Commit e5bf299

Browse files
committed
Replace browserify with rollup.
1 parent d6654b7 commit e5bf299

File tree

2 files changed

+42
-4
lines changed

2 files changed

+42
-4
lines changed

package.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
"unexpected-dom.min.js"
1010
],
1111
"scripts": {
12-
"bundle:browserify": "browserify lib/index.js --standalone unexpected.dom --debug --x jsdom > unexpected-dom.js",
13-
"bundle:min": "uglifyjs unexpected-dom.js > unexpected-dom.min.js",
14-
"bundle": "npm run bundle:browserify && npm run bundle:min",
12+
"bundle": "rollup -c",
1513
"build": "babel --out-dir lib --quiet src",
1614
"build-tests": "babel --out-dir build/test --quiet test",
1715
"changelog": "offline-github-changelog > CHANGELOG.md",
@@ -49,7 +47,6 @@
4947
"babel-cli": "^6.26.0",
5048
"babel-core": "^6.26.3",
5149
"babel-preset-env": "^1.7.0",
52-
"browserify": "^16.2.3",
5350
"coveralls": "^3.0.2",
5451
"eslint": "^6.0.0",
5552
"eslint-config-prettier": "^6.0.0",
@@ -72,6 +69,12 @@
7269
"nyc": "^14.0.0",
7370
"offline-github-changelog": "^1.2.0",
7471
"prettier": "~1.18.2",
72+
"rollup": "^1.0.2",
73+
"rollup-plugin-commonjs": "^10.0.0",
74+
"rollup-plugin-json": "^4.0.0",
75+
"rollup-plugin-node-globals": "^1.4.0",
76+
"rollup-plugin-node-resolve": "^5.0.0",
77+
"rollup-plugin-terser": "^5.1.2",
7578
"uglifyjs": "^2.4.11",
7679
"unexpected": "^11.6.1",
7780
"unexpected-documentation-site-generator": "^6.0.0",

rollup.config.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
var terser = require('rollup-plugin-terser').terser;
2+
3+
var plugins = [
4+
require('rollup-plugin-json')(),
5+
require('rollup-plugin-commonjs')(),
6+
require('rollup-plugin-node-resolve')(),
7+
require('rollup-plugin-node-globals')()
8+
];
9+
10+
module.exports = [
11+
{
12+
input: 'lib/index.js',
13+
output: {
14+
file: 'unexpected-dom.js',
15+
name: 'unexpected.dom',
16+
exports: 'named',
17+
format: 'umd',
18+
sourcemap: false,
19+
strict: false
20+
},
21+
plugins
22+
},
23+
{
24+
input: 'lib/index.js',
25+
output: {
26+
file: 'unexpected-dom.min.js',
27+
name: 'unexpected.dom',
28+
exports: 'named',
29+
format: 'umd',
30+
sourcemap: false,
31+
strict: false
32+
},
33+
plugins: plugins.concat([terser()])
34+
}
35+
];

0 commit comments

Comments
 (0)