diff --git a/.gitignore b/.gitignore index 98a3c17..9d3ab8e 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ coverage # Dist *.gz +.cache dist/ diff --git a/package.json b/package.json index 1cdf270..67edd26 100644 --- a/package.json +++ b/package.json @@ -21,41 +21,41 @@ ], "scripts": { "test": "jest --coverage --no-cache&& tsc -p test/ts", - "build": "npm run bundle && npm run minify", - "bundle": "rollup -i src/index.js -o dist/router.js -f umd -mn hyperappRouter -g hyperapp:hyperapp", - "minify": "uglifyjs dist/router.js -o dist/router.js -mc pure_funcs=['Object.defineProperty'] --source-map includeSources,url=router.js.map", + "build": "parcel build ./src/index.js --out-dir dist --out-file router.js --global hyperappRouter --no-autoinstall", "prepublish": "npm run build", "format": "prettier --semi false --write '{src,test}/**/*.js'", "release": "npm run build && npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish" }, "babel": { "presets": [ - "env" - ], - "plugins": [ [ - "transform-react-jsx", + "@babel/preset-env", { - "pragma": "h" + "forceAllTransforms": true } ] + ], + "plugins": [ + "@babel/plugin-transform-runtime" ] }, "jest": { "testURL": "http://localhost" }, "devDependencies": { + "@babel/core": "^7.2.2", + "@babel/plugin-transform-runtime": "^7.2.0", + "@babel/preset-env": "^7.2.3", "babel-jest": "^22.4.3", - "babel-plugin-transform-react-jsx": "^6.24.1", - "babel-preset-env": "^1.6.1", - "hyperapp": "^2.0.0", + "hyperapp": "github:jorgebucaran/hyperapp#V2", "jest": "^22.4.3", - "path-to-regexp": "^2.4.0", + "parcel-bundler": "^1.11.0", "prettier": "^1.11.1", - "rollup": "^0.57.1", - "uglify-js": "^3.3.16", "typescript": "2.8.1" }, + "dependencies": { + "path-to-regexp": "^2.4.0" + }, "peerDependencies": { "hyperapp": "2.0.0" } diff --git a/src/Route.js b/src/Route.js index 18070ea..dfd1844 100644 --- a/src/Route.js +++ b/src/Route.js @@ -26,7 +26,7 @@ export const Route = (context, child) => { context, path, url - }}, (props, ...args) => Route.call(this, { + }}, (props, ...args) => Route.call(undefined, { ...context, ...props, render: props.render || undefined, path: path + (props.path || ''),