diff --git a/package.json b/package.json index 0748634..de9c27a 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "devDependencies": { "babelify": "^6.3.0", "browserify": "^11.0.1", - "mochify": "^2.13.0" + "mochify": "^2.13.0", + "uglify-js": "^2.4.24" }, "browserify": { "transform": [ @@ -31,7 +32,7 @@ ] }, "scripts": { - "build": "browserify -o build/godash.js -r ./src/index.js:godash", + "build": "browserify -o ./build/godash.js -e ./src/browser.js && uglifyjs --compress --mangle --output build/godash.min.js -- build/godash.js", "test": "mochify", "watch-test": "mochify -w" } diff --git a/src/browser.js b/src/browser.js new file mode 100644 index 0000000..aeb8378 --- /dev/null +++ b/src/browser.js @@ -0,0 +1,6 @@ +import index from './index.js'; + + +if (!window.godash) { + window.godash = index; +}