Skip to content

Commit d353f8a

Browse files
authored
Fix requireSync within node (#13)
1 parent 93fea1e commit d353f8a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"build:esm:rename:map": "find ./lib -type f -name '*.js.map' | sed -E 's/^(.+)\\.js\\.map$/\\1/' | xargs -I % mv %.js.map %.mjs.map",
3939
"clean": "rm -rf cjs esm lib build temp .cache",
4040
"prepublishOnly": "run-s test build",
41+
"prepare": "run-s build",
4142
"start": "npm run clean && npm run build:esm -- --watch",
4243
"test": "jest",
4344
"compare:babel": "babel -o ./compare/output_babel.js ./compare/source.ts",

src/properties/createRequireSync.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const REQUIRE_SYNC_BODY = ts.factory.createReturnStatement(
99
ts.factory.createConditionalExpression(
1010
ts.factory.createBinaryExpression(
1111
ts.factory.createTypeOfExpression(
12-
ts.factory.createStringLiteral('__webpack_require__'),
12+
ts.factory.createIdentifier('__webpack_require__'),
1313
),
1414
ts.SyntaxKind.ExclamationEqualsEqualsToken,
1515
ts.factory.createStringLiteral('undefined'),

0 commit comments

Comments
 (0)