Skip to content

Commit 06f26b3

Browse files
authored
use parcel (#13)
* refactor package.json * use parcel
1 parent 4d0c6f4 commit 06f26b3

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
/.psa*
1010
/.spago/
1111
/dist/
12+
/.cache/

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ script:
2727
- spago test
2828
- spago docs
2929
- npm run build
30-
- node dist/main.js build-index
30+
- ./dist/purescript-docs-search build-index
3131

3232
deploy:
3333
- provider: releases
3434
api_key: $API_KEY
3535
file:
3636
- dist/docs-search-app.js
37-
- dist/main.js
37+
- dist/purescript-docs-search
3838
skip_cleanup: true
3939
on:
4040
tags: true

package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test": "test"
88
},
99
"bin": {
10-
"purescript-docs-search": "dist/main.js"
10+
"purescript-docs-search": "dist/purescript-docs-search"
1111
},
1212
"files": [
1313
"dist/main.js",
@@ -17,8 +17,14 @@
1717
"scripts": {
1818
"test": "spago test",
1919
"bundle-app": "spago bundle-app -m Docs.Search.App --to dist/docs-search-app.js",
20-
"bundle-main": "spago bundle-app -m Docs.Search.Main --to dist/main.js && browserify --no-builtins --no-commondir --no-detect-globals --node dist/main.js --outfile dist/main-bundled.js && echo \"#!/usr/bin/env node\" > dist/main.js && cat dist/main-bundled.js >> dist/main.js && rm dist/main-bundled.js",
21-
"build": "npm run bundle-app && npm run bundle-main",
20+
"parcel-app": "parcel build --no-source-maps --target browser --out-file dist/docs-search-app.js dist/docs-search-app.js",
21+
"build-app": "npm run bundle-app && npm run parcel-app",
22+
"bundle-main": "spago bundle-app -m Docs.Search.Main --to dist/main.js",
23+
"parcel-main": "parcel build --no-source-maps --target node --bundle-node-modules --out-file dist/main.js dist/main.js",
24+
"add-shebang": "echo \"#!/usr/bin/env node\" > dist/purescript-docs-search && cat dist/main.js >> dist/purescript-docs-search",
25+
"chmod-main": "chmod +x dist/purescript-docs-search",
26+
"build-main": "npm run bundle-main && npm run parcel-main && npm run add-shebang && rm dist/main.js && npm run chmod-main",
27+
"build": "npm run build-app && npm run build-main",
2228
"clean": "rm -rf dist"
2329
},
2430
"repository": {
@@ -36,8 +42,8 @@
3642
"homepage": "https://github.com/spacchetti/purescript-docs-search#readme",
3743
"dependencies": {},
3844
"devDependencies": {
39-
"browserify": "^16.3.0",
4045
"glob": "^7.1.4",
46+
"parcel": "^1.12.3",
4147
"spago": "^0.8.5"
4248
}
4349
}

0 commit comments

Comments
 (0)