diff --git a/after.js b/after.js new file mode 100644 index 0000000..645e0e4 --- /dev/null +++ b/after.js @@ -0,0 +1 @@ +}(typeof window === 'object' ? window : this)); diff --git a/before.js b/before.js new file mode 100644 index 0000000..59382da --- /dev/null +++ b/before.js @@ -0,0 +1,3 @@ +'use strict'; + +(function (window) { diff --git a/package.json b/package.json index 012a914..dd46ba5 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "test": "./node_modules/.bin/karma start --single-run", "prebuild": "rm -rf dist && mkdir dist", "postbuild": "uglifyjs dist/filepicker.js -o ./dist/filepicker.min.js --compress --mangle && cp filepicker_debug.js dist/", - "build": "uglifyjs ./src/setup.js ./src/**/*.js ./src/finalize.js -o ./dist/filepicker.js -b ", + "build": "(cat ./before.js && uglifyjs ./src/setup.js ./src/**/*.js ./src/finalize.js -b && cat ./after.js) > ./dist/filepicker.js", "watch": "onchange ./src/*.js ./src/**/*.js -- npm run build", "watch-test": "onchange ./tests/unit/*.js ./tests/unit/**/*.js ./src/*.js ./src/**/*.js -- npm run test", "linter": "jshint ./src/*.js ./src/**/*.js",