Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 4799271

Browse files
committed
fix: avoid getting invalid require calls when building from Windows
1 parent a6c215a commit 4799271

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: plugins/GenerateNativeScriptEntryPointsPlugin.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const { convertToUnixPath } = require("../lib/utils");
12
const { RawSource } = require("webpack-sources");
23
const { getPackageJson } = require("../projectHelpers");
34
const { SNAPSHOT_ENTRY_NAME } = require("./NativeScriptSnapshotPlugin");
@@ -77,8 +78,9 @@ exports.GenerateNativeScriptEntryPointsPlugin = (function () {
7778

7879
const requireDeps = requiredFiles.map(depPath => {
7980
const depRelativePath = path.join(pathToRootFromCurrFile, depPath);
81+
const depRelativePathUnix = convertToUnixPath(depRelativePath);
8082

81-
return `require("./${depRelativePath}");`;
83+
return `require("./${depRelativePathUnix}");`;
8284
}).join("");
8385
const currentEntryFileContent = compilation.assets[filePath].source();
8486
compilation.assets[filePath] = new RawSource(`${requireDeps}${currentEntryFileContent}`);

0 commit comments

Comments
 (0)