Skip to content

Commit 8c549ac

Browse files
committed
build: fix animations bundle on postinstall
revert after this fix: angular/angular#15300
1 parent 8d832bc commit 8c549ac

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Diff for: nativescript-angular/postinstall.js

+12
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
var fs = require("fs");
22
var os = require("os");
3+
var path = require("path");
34
var hookHelper = require("./hooks/hook-helper");
45
var projectDir = hookHelper.findProjectDir();
56

67
if (projectDir) {
8+
var bundlePath = path.join(projectDir, "node_modules/@angular/animations/browser/package.json");
9+
10+
try {
11+
var content = require(bundlePath);
12+
content.main = "../bundles/animations-browser.umd.js";
13+
console.log(content)
14+
fs.writeFileSync(bundlePath, JSON.stringify(content), "utf8");
15+
} catch(e) {
16+
console.error(e.message);
17+
}
18+
719
var hooksDir = hookHelper.getHooksDir(),
820
beforeLivesyncHookDir = hookHelper.getBeforeLivesyncHookDir(),
921
content = 'module.exports = require("nativescript-angular/hooks/before-livesync");';

0 commit comments

Comments
 (0)