Skip to content

Commit

Permalink
Separate build targets for Node and browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornharrtell committed Feb 7, 2016
1 parent b77baa6 commit 4928752
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"rollup": "0.25.2",
"uglify-js": "2.6.1"
},
"main": "src/index.js",
"main": "dist/jsts.min.js",
"engines": {
"node": ">= 4"
},
Expand All @@ -39,7 +39,8 @@
},
"scripts": {
"test": "NODE_PATH=src mocha --compilers js:babel-register --recursive test",
"build": "rollup -c | browserify -t babelify - | uglifyjs -c -m > jsts.min.js"
"build node": "rollup -c rollup.config.node.js | babel --presets es2015 | uglifyjs -c -m > dist/jsts.min.js",
"build browser": "rollup -c rollup.config.browser.js | browserify -t babelify - | uglifyjs -c -m > dist/jsts.min.js"
},
"jspm": {
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js → rollup.config.browser.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
entry: 'src/lib.js',
entry: 'src/global.js',
format: 'iife',
moduleName: 'jsts'
}
4 changes: 4 additions & 0 deletions rollup.config.node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
entry: 'src/jsts.js',
format: 'cjs'
}
2 changes: 1 addition & 1 deletion src/global.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import jsts from './'
import jsts from './jsts'

global.jsts = jsts
File renamed without changes.

0 comments on commit 4928752

Please sign in to comment.