diff --git a/package.json b/package.json index 806c18e1e..3860d36aa 100644 --- a/package.json +++ b/package.json @@ -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" }, @@ -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": { diff --git a/rollup.config.js b/rollup.config.browser.js similarity index 69% rename from rollup.config.js rename to rollup.config.browser.js index 26417478d..d6eca1840 100644 --- a/rollup.config.js +++ b/rollup.config.browser.js @@ -1,5 +1,5 @@ export default { - entry: 'src/lib.js', + entry: 'src/global.js', format: 'iife', moduleName: 'jsts' } diff --git a/rollup.config.node.js b/rollup.config.node.js new file mode 100644 index 000000000..b8bedcd53 --- /dev/null +++ b/rollup.config.node.js @@ -0,0 +1,4 @@ +export default { + entry: 'src/jsts.js', + format: 'cjs' +} diff --git a/src/global.js b/src/global.js index 4abd81f41..14d12dedb 100644 --- a/src/global.js +++ b/src/global.js @@ -1,3 +1,3 @@ -import jsts from './' +import jsts from './jsts' global.jsts = jsts diff --git a/src/index.js b/src/jsts.js similarity index 100% rename from src/index.js rename to src/jsts.js