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

Commit efbfd3c

Browse files
author
Dimitar Tachev
authored
Merge pull request #1097 from NativeScript/kddimitrov/fix-bundle-emit-empty-save
fix: bundle emitted on save without changes
2 parents 7cd56b5 + 2d01df9 commit efbfd3c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

plugins/GenerateNativeScriptEntryPointsPlugin.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const { convertToUnixPath } = require("../lib/utils");
2-
const { RawSource } = require("webpack-sources");
2+
const { RawSource, ConcatSource } = require("webpack-sources");
33
const { getPackageJson } = require("../projectHelpers");
44
const { SNAPSHOT_ENTRY_NAME } = require("./NativeScriptSnapshotPlugin");
55
const path = require("path");
@@ -83,7 +83,12 @@ exports.GenerateNativeScriptEntryPointsPlugin = (function () {
8383
return `require("./${depRelativePathUnix}");`;
8484
}).join("");
8585
const currentEntryFileContent = compilation.assets[filePath].source();
86-
compilation.assets[filePath] = new RawSource(`${requireDeps}${currentEntryFileContent}`);
86+
87+
if(compilation.assets[filePath] instanceof ConcatSource) {
88+
compilation.assets[filePath].children.unshift(`${requireDeps}`);
89+
} else {
90+
compilation.assets[filePath] = new RawSource(`${requireDeps}${currentEntryFileContent}`);
91+
}
8792
}
8893
});
8994
}

0 commit comments

Comments
 (0)