Skip to content

Commit 64156f7

Browse files
authored
Merge pull request #338 from kellyselden/manual-disable
process.env.FASTBOOT_DISABLED to disable fastboot build
2 parents f217432 + 5121d3a commit 64156f7

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,21 @@ Prototype extensions do not currently work across node "realms." Fastboot
385385
applications operate in two realms, a normal node environment and a [virtual machine](https://nodejs.org/api/vm.html). Passing objects that originated from the normal realm will not contain the extension methods
386386
inside of the sandbox environment. For this reason, it's encouraged to [disable prototype extensions](https://guides.emberjs.com/v2.4.0/configuring-ember/disabling-prototype-extensions/).
387387

388+
### Double build times and no incremental builds
389+
390+
Due to limitations in Ember CLI, builds take twice as long to generate the
391+
second set of FastBoot assets. This also means incremental builds with
392+
live reload don't work either. This aims to be resolved by FastBoot 1.0.
393+
In the mean time, we introduce a short-circuit evironment flag to not do
394+
a FastBoot build:
395+
396+
```
397+
FASTBOOT_DISABLED=true ember build
398+
```
399+
400+
This is useful to keep your existing workflow while in development, while
401+
still being able to deploy FastBoot. This flag will be removed in FastBoot
402+
1.0.
388403

389404
## Troubleshooting
390405

index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,12 @@ module.exports = {
112112
/**
113113
* After the entire Broccoli tree has been built for the `dist` directory,
114114
* adds the `fastboot-config.json` file to the root.
115+
*
116+
* FASTBOOT_DISABLED is a pre 1.0 power user flag to
117+
* disable the fastboot build while retaining the fastboot service.
115118
*/
116119
postprocessTree: function(type, tree) {
117-
if (type === 'all') {
120+
if (type === 'all' && !process.env.FASTBOOT_DISABLED) {
118121
var fastbootTree = this.buildFastBootTree();
119122

120123
// Merge the package.json with the existing tree
@@ -148,7 +151,7 @@ module.exports = {
148151
if (emberVersionChecker.version) {
149152
return emberVersionChecker;
150153
}
151-
154+
152155
return checker.for('ember', 'bower');
153156
},
154157

0 commit comments

Comments
 (0)