Skip to content

Commit

Permalink
Logging in export fly
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketfuryrocks committed Jul 5, 2020
1 parent fdec79d commit c63af19
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
32 changes: 16 additions & 16 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions dist/FireJSX.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,26 +141,27 @@ class default_1 {
const promises = [];
for (const page of this.$.pageMap.values()) {
promises.push(new Promise(resolve => this.$.pageArchitect.buildPage(page, () => {
this.$.cli.ok(`Page : ${page.toString()}`);
map.pageMap[page.toString()] = page.chunks;
page.chunks.forEach(chunk => {
if (chunk.endsWith(".js")) {
const chunkPath = path_1.join(this.$.config.paths.lib, chunk);
this.$.outputFileSystem.copyFile(chunkPath, path_1.join(this.$.config.paths.fly, chunk), err => {
resolve();
if (err)
throw new Error(`Error while moving ${chunkPath} to ${this.$.config.paths.fly}`);
throw new Error(`Error moving ${chunkPath} to ${this.$.config.paths.fly}`);
});
}
});
}, (e) => {
this.$.cli.error(`Error while building page ${page}\n`, e);
this.$.cli.error(`Error building page ${page}\n`, e);
throw "";
})));
}
const fullExternalName = map.staticConfig.externals[0].substr(map.staticConfig.externals[0].lastIndexOf("/") + 1);
this.$.outputFileSystem.rename(path_1.join(this.$.config.paths.lib, map.staticConfig.externals[0]), path_1.join(this.$.config.paths.fly, fullExternalName), err => {
if (err)
throw new Error(`Error while moving ${fullExternalName} to ${this.$.config.paths.fly}`);
throw new Error(`Error moving ${fullExternalName} to ${this.$.config.paths.fly}`);
map.staticConfig.externals[0] = fullExternalName;
Promise.all(promises).then(() => this.$.outputFileSystem.writeFile(path_1.join(this.$.config.paths.fly, "firejsx.map.json"), JSON.stringify(map), resolve));
});
Expand Down
7 changes: 4 additions & 3 deletions src/FireJSX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,27 +183,28 @@ export default class {
for (const page of this.$.pageMap.values()) {
promises.push(new Promise(resolve =>
this.$.pageArchitect.buildPage(page, () => {
this.$.cli.ok(`Page : ${page.toString()}`)
map.pageMap[page.toString()] = page.chunks;
page.chunks.forEach(chunk => {
if (chunk.endsWith(".js")) {
const chunkPath = join(this.$.config.paths.lib, chunk);
this.$.outputFileSystem.copyFile(chunkPath, join(this.$.config.paths.fly, chunk), err => {
resolve();
if (err)
throw new Error(`Error while moving ${chunkPath} to ${this.$.config.paths.fly}`);
throw new Error(`Error moving ${chunkPath} to ${this.$.config.paths.fly}`);
});
}
})
}, (e) => {
this.$.cli.error(`Error while building page ${page}\n`, e);
this.$.cli.error(`Error building page ${page}\n`, e);
throw "";
})
))
}
const fullExternalName = map.staticConfig.externals[0].substr(map.staticConfig.externals[0].lastIndexOf("/") + 1);
this.$.outputFileSystem.rename(join(this.$.config.paths.lib, map.staticConfig.externals[0]), join(this.$.config.paths.fly, fullExternalName), err => {
if (err)
throw new Error(`Error while moving ${fullExternalName} to ${this.$.config.paths.fly}`);
throw new Error(`Error moving ${fullExternalName} to ${this.$.config.paths.fly}`);
map.staticConfig.externals[0] = fullExternalName;
Promise.all(promises).then(() =>
this.$.outputFileSystem.writeFile(join(this.$.config.paths.fly, "firejsx.map.json"),
Expand Down

0 comments on commit c63af19

Please sign in to comment.