Skip to content

Commit a4449cb

Browse files
committed
feat(build): uglify generated web workers
Since these are shipped with browser-based code, they should be small. Addresses #11
1 parent e81145d commit a4449cb

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

build.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ const browserifyBuild = ramda.curry(function (outputDir, es6File, callback) {
128128
let basename = path.basename(es6File)
129129
let output = path.join(outputDir, basename)
130130
console.log('Converting ' + basename + ' ...')
131-
browserify(es6File)
131+
const bundler = browserify(es6File)
132+
bundler.transform({global: true}, 'uglifyify')
133+
bundler
132134
.transform('babelify', {presets: ['es2015']})
133135
.bundle()
134136
.pipe(fs.createWriteStream(output))

package.json

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88
"test": "test"
99
},
1010
"scripts": {
11-
"doc" : "kw-doc -c ./doc/config.js",
12-
"doc:www" : "kw-doc -c ./doc/config.js -s",
13-
"doc:publish" : "kw-doc -c ./doc/config.js -mp",
14-
15-
"commit" : "git cz",
11+
"doc": "kw-doc -c ./doc/config.js",
12+
"doc:www": "kw-doc -c ./doc/config.js -s",
13+
"doc:publish": "kw-doc -c ./doc/config.js -mp",
14+
"commit": "git cz",
1615
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
17-
1816
"build": "node ./build.js",
1917
"test": "./build/dockcross bash -c \"cd build && ctest -V\" && standard \"src/*.js\" \"test/**/*.js\" && ava \"test/*.js\" && NODE_PATH=$PWD/dist browserify test/Browser/*.js | tape-run --render=\"tap-spec\" --static \"dist/\" --browser firefox"
2018
},
@@ -41,30 +39,30 @@
4139
},
4240
"homepage": "https://github.com/InsightSoftwareConsortium/ITKBridgeJavaScript#readme",
4341
"devDependencies": {
44-
"kw-doc": "1.0.20",
45-
"commitizen": "2.9.6",
46-
"cz-conventional-changelog": "2.0.0",
47-
"semantic-release": "6.3.6",
48-
"condition-circle": "1.5.0",
49-
5042
"async": "^2.0.1",
5143
"ava": "^0.19.1",
5244
"babel-core": "^6.24.1",
5345
"babel-preset-es2015": "^6.24.1",
5446
"babelify": "^7.3.0",
5547
"browserify": "^14.3.0",
48+
"commitizen": "2.9.6",
49+
"condition-circle": "1.5.0",
50+
"cz-conventional-changelog": "2.0.0",
5651
"file-api": "^0.10.4",
5752
"fs": "0.0.1-security",
5853
"fs-extra": "^0.30.0",
5954
"glob": "^7.0.6",
6055
"json-loader": "^0.5.4",
56+
"kw-doc": "1.0.20",
6157
"promise-file-reader": "^0.3.1",
6258
"promise-worker-transferable": "^1.0.4",
6359
"ramda": "^0.23.0",
60+
"semantic-release": "6.3.6",
6461
"standard": "^8.6.0",
6562
"tap-spec": "^4.1.1",
6663
"tape": "^4.6.3",
67-
"tape-run": "^3.0.0"
64+
"tape-run": "^3.0.0",
65+
"uglifyify": "^3.0.4"
6866
},
6967
"dependencies": {
7068
"mime-types": "^2.1.15",

0 commit comments

Comments
 (0)