Skip to content

Commit faec186

Browse files
committed
move rr copy to prebuild hook
1 parent aa2e4e4 commit faec186

File tree

3 files changed

+232
-20
lines changed

3 files changed

+232
-20
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
]
1616
},
1717
"scripts": {
18-
"build": "rollup -c && node scripts/copy-to-root.mjs",
18+
"prebuild": "cpy 'packages/react-router-dom/*.ts*' packages/react-router-dom-v5-compat/react-router-dom",
19+
"build": "rollup -c",
20+
"postbuild": "node scripts/copy-to-root.mjs",
1921
"changeset": "changeset",
2022
"clean": "git clean -fdX .",
2123
"format": "prettier --ignore-path .eslintignore --write .",
@@ -70,6 +72,7 @@
7072
"babel-plugin-dev-expression": "^0.2.2",
7173
"chalk": "^4.1.1",
7274
"cheerio": "^1.0.0-rc.10",
75+
"cpy-cli": "^4.1.0",
7376
"eslint": "^7.30.0",
7477
"eslint-config-react-app": "^6.0.0",
7578
"eslint-plugin-flowtype": "^5.8.0",

rollup.config.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -748,8 +748,6 @@ function reactRouterDomV5Compat() {
748748
let PACKAGE_NAME = "react-router-dom-v5-compat";
749749
let SOURCE_DIR = `packages/${PACKAGE_NAME}`;
750750
let OUTPUT_DIR = `${SOURCE_DIR}/dist`;
751-
let ROUTER_DOM_SOURCE = "packages/react-router-dom/(index|dom).ts*";
752-
let ROUTER_DOM_COPY_DEST = `${SOURCE_DIR}/react-router-dom`;
753751

754752
let version = getVersion(SOURCE_DIR);
755753

@@ -772,10 +770,6 @@ function reactRouterDomV5Compat() {
772770
"react-router-dom",
773771
],
774772
plugins: [
775-
copy({
776-
targets: [{ src: ROUTER_DOM_SOURCE, dest: ROUTER_DOM_COPY_DEST }],
777-
hook: "buildStart",
778-
}),
779773
extensions({ extensions: [".tsx", ".ts"] }),
780774
babel({
781775
babelHelpers: "bundled",
@@ -972,15 +966,15 @@ function reactRouterNative() {
972966

973967
/**
974968
* @param {RollupInputOptions[]} options
975-
* @return {Promise<RollupOptions[]>}
969+
* @return {RollupOptions[]}
976970
*/
977-
export default async function rollup(options) {
971+
export default function rollup(options) {
978972
let builds = [
979973
...router(options),
980974
...reactRouter(options),
981975
...reactRouterDom(options),
982-
...reactRouterDomV5Compat(options),
983976
...reactRouterNative(options),
977+
...reactRouterDomV5Compat(options),
984978
];
985979
return builds;
986980
}

0 commit comments

Comments
 (0)