Skip to content

Commit

Permalink
Fix minify (#21)
Browse files Browse the repository at this point in the history
* restoring minify (reverted from commit e65ff24)

* reveal problem by using dist for tests

* use good syntax in the minify command

* build before test
fixes issue with node 6
  • Loading branch information
okwolf authored Feb 25, 2018
1 parent 51a631d commit 59ac5c5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ install:
- npm i

script:
- npm run build
- npm test
- codecov

Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
"hyperapp": "^1.1.2",
"jest": "^21.2.1",
"prettier": "^1.8.2",
"rollup": "^0.55.5"
"rollup": "^0.55.5",
"uglify-js": "^3.2.1"
},
"scripts": {
"test": "jest --coverage --no-cache",
"bundle": "rollup -i src/index.js -o dist/effects.js -f umd -n effects",
"prepare": "npm run bundle",
"build": "npm run bundle && npm run minify",
"bundle": "rollup -i src/index.js -o dist/effects.js -m -f umd -n effects",
"minify": "uglifyjs dist/effects.js -o dist/effects.js -mc pure_funcs=['Object.defineProperty'] --source-map includeSources,url=effects.js.map",
"prepare": "npm run build",
"format": "prettier --semi false --write '{src,test}/**/*.js'"
},
"babel": {
Expand Down
6 changes: 4 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ export function assign(source, assignments) {
export function omit(object, keys) {
var copy = {}
Object.keys(object)
.filter(key => keys.indexOf(key) === -1)
.forEach(key => {
.filter(function(key) {
return keys.indexOf(key) === -1
})
.forEach(function(key) {
copy[key] = object[key]
})
return copy
Expand Down
2 changes: 1 addition & 1 deletion test/effectsIf.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action, effectsIf } from "../src"
import { action, effectsIf } from "../dist/effects"

describe("effectsIf", () => {
it("should filter out effects with truthy conditionals", () =>
Expand Down
2 changes: 1 addition & 1 deletion test/withEffects.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
keydown,
keyup,
random
} from "../src"
} from "../dist/effects"

describe("withEffects", () => {
it("should be a function", () => expect(withEffects).toBeInstanceOf(Function))
Expand Down

0 comments on commit 59ac5c5

Please sign in to comment.