Skip to content

Commit

Permalink
Fix 'handlebarsConfig' file not found on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
asbjornh committed Jan 16, 2023
1 parent 37bfc3c commit 6af9ab6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.9.4

- Fix `handlebarsConfig` file not found on Windows

## 1.9.3

- Fix `handlebarsConfig` file not found even when path is correct
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Module Templates",
"publisher": "asbjornh",
"icon": "icon.png",
"version": "1.9.3",
"version": "1.9.4",
"description": "A VSCode extension for creating file/folder templates for new modules",
"scripts": {
"vscode:prepublish": "webpack",
Expand Down
4 changes: 2 additions & 2 deletions source/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ export function getEngine(root: WorkspaceFolder): Engine {

const tryRequire = (path: string) => {
try {
// NOTE: Webpack does some shenanigans with `require` building (this does not happen when debugging the extension in VSCode)
return eval(`require("${path}")`);
// NOTE: Webpack does some shenanigans with `require` when building (this does not happen when debugging the extension in VSCode)
return eval("require")(path);
} catch (error) {
throw new Error(
`${error.name}: ${error.message} in ${error.stack.split("\n")[0]}`,
Expand Down

0 comments on commit 6af9ab6

Please sign in to comment.