Skip to content

Commit

Permalink
Returns 'null' from resolve id hook rather than undefined to fix comp…
Browse files Browse the repository at this point in the history
…atibility issue with newest Rollup version
  • Loading branch information
wessberg committed Jun 21, 2019
1 parent 7ce6306 commit 2ebf7a6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
33 changes: 17 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions test/setup/setup-rollup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit 2ebf7a6

Please sign in to comment.