Skip to content

Commit 8c582b5

Browse files
fix(browser): fix browser support and make it build faster
1 parent 74a72ef commit 8c582b5

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

package.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"version": "1.0.3",
44
"description": "Busca por CEP integrado diretamente aos serviços dos Correios e ViaCEP",
55
"main": "dist/cep-promise.js",
6-
"browser": "dist/cep-promise-browser.min.js",
76
"scripts": {
87
"test": "npm run coverage",
98
"coverage": "babel-node node_modules/.bin/babel-istanbul cover _mocha -- --timeout 30000 test/**/*.spec.js",
@@ -14,10 +13,25 @@
1413
"lint-check": "standard",
1514
"lint-fix": "standard --fix",
1615
"build-node": "babel src --out-dir dist",
17-
"build-web": "npm run build-node && browserify dist/cep-promise.js -s cep -o | uglifyjs > dist/cep-promise-browser.min.js",
16+
"build-web": "browserify src/cep-promise.js -s cep -o | uglifyjs > dist/cep-promise-browser.min.js",
1817
"build": "npm run build-node && npm run build-web",
1918
"prepublish": "npm run build"
2019
},
20+
"browserify": {
21+
"transform": [
22+
[
23+
"babelify",
24+
{
25+
"presets": [
26+
"es2015"
27+
],
28+
"plugins": [
29+
"add-module-exports"
30+
]
31+
}
32+
]
33+
]
34+
},
2135
"repository": {
2236
"type": "git",
2337
"url": "https://github.com/filipedeschamps/cep-promise.git"
@@ -35,6 +49,7 @@
3549
"babel-istanbul": "0.11.0",
3650
"babel-plugin-add-module-exports": "0.2.1",
3751
"babel-preset-es2015": "6.13.2",
52+
"babelify": "7.3.0",
3853
"browserify": "13.1.0",
3954
"chai": "3.5.0",
4055
"chai-as-promised": "5.3.0",

0 commit comments

Comments
 (0)