From 2ebf7a6d223b08a0dc69f27102665f2dbe2f177b Mon Sep 17 00:00:00 2001 From: wessberg Date: Fri, 21 Jun 2019 12:02:16 +0200 Subject: [PATCH] Returns 'null' from resolve id hook rather than undefined to fix compatibility issue with newest Rollup version --- package.json | 33 +++++++++++++++++---------------- test/setup/setup-rollup.ts | 4 ++-- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 9b41511..0afcaa6 100644 --- a/package.json +++ b/package.json @@ -44,34 +44,35 @@ "url": "https://github.com/wessberg", "imageUrl": "https://avatars2.githubusercontent.com/u/20454213?s=460&v=4", "role": "Lead Developer", - "twitter": "FredWessberg" + "twitter": "FredWessberg", + "github": "wessberg" } ], "license": "MIT", "devDependencies": { - "core-js": "3.1.3", + "core-js": "3.1.4", "@wessberg/scaffold": "1.0.18", - "@wessberg/ts-config": "0.0.40", - "@wessberg/rollup-plugin-ts": "1.1.54", - "rollup-plugin-node-resolve": "5.0.0", - "rollup": "1.12.4", - "rollup-pluginutils": "2.7.1", - "ava": "1.4.1", + "@wessberg/ts-config": "0.0.41", + "@wessberg/rollup-plugin-ts": "1.1.58", + "rollup-plugin-node-resolve": "5.0.3", + "rollup": "1.15.6", + "rollup-pluginutils": "2.8.1", + "ava": "2.1.0", "standard-changelog": "2.0.11", - "ts-node": "8.2.0", - "tslint": "5.16.0", - "prettier": "1.17.1", - "pretty-quick": "1.11.0", - "husky": "2.3.0", - "np": "5.0.2" + "ts-node": "8.3.0", + "tslint": "5.17.0", + "prettier": "1.18.2", + "pretty-quick": "1.11.1", + "husky": "2.4.1", + "np": "5.0.3" }, "dependencies": { - "@types/node": "12.0.3", + "@types/node": "12.0.8", "@types/reserved-words": "^0.1.0", "@types/resolve": "0.0.8", "@wessberg/stringutil": "1.0.18", "reserved-words": "^0.1.2", - "typescript": "3.5.1", + "typescript": "3.5.2", "resolve": "1.11.0" }, "main": "./dist/cjs/index.js", diff --git a/test/setup/setup-rollup.ts b/test/setup/setup-rollup.ts index 16698c1..179c23e 100644 --- a/test/setup/setup-rollup.ts +++ b/test/setup/setup-rollup.ts @@ -42,14 +42,14 @@ export async function generateRollupBundle(inputFiles: TestFile[] | TestFile, ro throw new ReferenceError(`No entry could be found`); } - const resolveId = (fileName: string, parent: string | null): string | undefined => { + const resolveId = (fileName: string, parent: string | undefined): string | null => { const absolute = isAbsolute(fileName) ? fileName : join(parent == null ? "" : dirname(parent), fileName); for (const ext of ["", ".ts", ".js", ".mjs"]) { const withExtension = `${absolute}${ext}`; const matchedFile = files.find(file => file.fileName === withExtension); if (matchedFile != null) return withExtension; } - return undefined; + return null; }; const load = (id: string): string | null => {