Skip to content

Commit

Permalink
Change build to rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
oneut committed Sep 15, 2018
1 parent e2fca7a commit adfc684
Show file tree
Hide file tree
Showing 8 changed files with 1,681 additions and 2,506 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.nyc_output
build
coverage
node_modules
./docs
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ typings/
.env

# For Module
build
examples/**/build
/lib
/ssr
.DS_Store
Expand Down
11 changes: 11 additions & 0 deletions build/createRollupConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import babel from "rollup-plugin-babel";
import filesize from "rollup-plugin-filesize";

export function createRollupConfig(config) {
return {
input: config.input,
output: config.output,
external: ["history", "path-to-regexp", "react", "rxjs", "rxjs/operators"],
plugins: [babel(), filesize()]
};
}
11 changes: 11 additions & 0 deletions build/rollup.lib.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { createRollupConfig } from "./createRollupConfig";

export default createRollupConfig({
input: "src/lib/index.js",
output: {
file: "lib/index.js",
format: "cjs",
name: "async-react-router",
sourcemap: true
}
});
11 changes: 11 additions & 0 deletions build/rollup.ssr.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { createRollupConfig } from "./createRollupConfig";

export default createRollupConfig({
input: "src/ssr/index.js",
output: {
file: "ssr/index.js",
format: "cjs",
name: "async-react-router-ssr",
sourcemap: true
}
});
4,086 changes: 1,612 additions & 2,474 deletions package-lock.json

Large diffs are not rendered by default.

57 changes: 30 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"main": "lib/index.js",
"scripts": {
"build": "npm run build:lib && npm run build:ssr",
"build:lib": "rimraf lib && cross-env NODE_ENV=production babel src/lib -d lib/ --source-maps inline",
"build:ssr": "rimraf ssr && cross-env NODE_ENV=production babel src/ssr -d ssr/",
"lint": "eslint ./src ./test",
"lint:fix": "eslint --fix ./src ./test",
"prepublish": "npm run build",
"build:lib": "rimraf lib && cross-env NODE_ENV=production rollup -c build/rollup.lib.config.js",
"build:ssr": "rimraf ssr && cross-env NODE_ENV=production rollup -c build/rollup.ssr.config.js",
"lint": "eslint ./src ./test ./build",
"lint:fix": "eslint --fix ./src ./test ./build",
"prepare": "npm run build",
"test": "nyc ava --verbose",
"report": "nyc report --reporter=html",
"commit": "git-cz"
Expand All @@ -24,41 +24,44 @@
},
"dependencies": {
"history": "^4.7.2",
"path-to-regexp": "^2.2.1"
"path-to-regexp": "^2.4.0"
},
"devDependencies": {
"@babel/cli": "7.0.0-rc.1",
"@babel/core": "7.0.0-rc.1",
"@babel/plugin-transform-runtime": "7.0.0-rc.1",
"@babel/preset-env": "7.0.0-rc.1",
"@babel/preset-react": "7.0.0-rc.1",
"@babel/register": "7.0.0-rc.1",
"@babel/runtime": "7.0.0-rc.1",
"ava": "1.0.0-beta.7",
"babel-eslint": "^8.2.6",
"babel-loader": "^8.0.0-beta.0",
"@babel/cli": "7.0.0",
"@babel/core": "7.0.1",
"@babel/plugin-transform-runtime": "7.0.0",
"@babel/preset-env": "7.0.0",
"@babel/preset-react": "7.0.0",
"@babel/register": "7.0.0",
"@babel/runtime": "7.0.0",
"ajv": "^6.5.3",
"ava": "1.0.0-beta.8",
"babel-eslint": "^9.0.0",
"babel-plugin-dynamic-import-node": "^2.1.0",
"babel-plugin-istanbul": "^4.1.6",
"babel-plugin-istanbul": "^5.0.1",
"browser-env": "^3.2.5",
"commitizen": "^2.10.1",
"coveralls": "^3.0.2",
"cross-env": "^5.2.0",
"cz-conventional-changelog": "^2.1.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.2.0",
"eslint": "^5.3.0",
"enzyme": "^3.6.0",
"enzyme-adapter-react-16": "^1.5.0",
"eslint": "^5.6.0",
"eslint-config-prettier": "^3.0.1",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-prettier": "^2.6.2",
"husky": "^1.0.0-rc.13",
"nyc": "12.0.2",
"nyc": "13.0.1",
"prettier": "1.14.2",
"react": "^16.4.2",
"react-dom": "^16.4.2",
"react-test-renderer": "^16.4.2",
"react": "^16.5.1",
"react-dom": "^16.5.1",
"react-test-renderer": "^16.5.1",
"rimraf": "^2.6.2",
"rxjs": "^6.2.2",
"sinon": "^6.1.4"
"rollup": "^0.65.2",
"rollup-plugin-babel": "^4.0.3",
"rollup-plugin-filesize": "^4.0.1",
"rxjs": "^6.3.2",
"sinon": "^6.3.3"
},
"repository": {
"type": "git",
Expand Down
8 changes: 5 additions & 3 deletions src/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import createBrowserHistory from "history/createBrowserHistory";
import createHashHistory from "history/createHashHistory";
import createMemoryHistory from "history/createMemoryHistory";
import {
createBrowserHistory,
createHashHistory,
createMemoryHistory
} from "history";
import { Link, Request, URL, connector } from "./Facade";
import Router from "./Router";

Expand Down

0 comments on commit adfc684

Please sign in to comment.