Skip to content

Commit 201bc15

Browse files
authored
Merge pull request #631 from embermap/disable-outputReady
disable `outputReady` hook logic in production
2 parents dc76b3a + d4c88d6 commit 201bc15

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

index.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,21 @@ module.exports = {
4848

4949
// we have to use the outputReady hook to ensure that ember-cli has finished copying the contents to the outputPath directory
5050
outputReady(result) {
51-
// NOTE: result.directory is not updated and still references the same path as postBuild hook (this might be a bug in ember-cli)
52-
// Set the distPath to the "final" outputPath, where EMBER_CLI_TEST_OUTPUT is the path passed to testem (set by ember-cli).
53-
// We fall back to result.directory if EMBER_CLI_TEST_OUTPUT is not set.
54-
let distPath = process.env.EMBER_CLI_TEST_OUTPUT || result.directory;
55-
let { pkg } = this.project;
56-
57-
if (this.fastboot) {
58-
reloadServer(this.fastboot, distPath);
59-
} else {
60-
this.fastboot = createServer(distPath, pkg);
51+
const isEnabled =
52+
this.app.name === 'dummy' || this.app.env !== 'production';
53+
54+
if (isEnabled) {
55+
// NOTE: result.directory is not updated and still references the same path as postBuild hook (this might be a bug in ember-cli)
56+
// Set the distPath to the "final" outputPath, where EMBER_CLI_TEST_OUTPUT is the path passed to testem (set by ember-cli).
57+
// We fall back to result.directory if EMBER_CLI_TEST_OUTPUT is not set.
58+
let distPath = process.env.EMBER_CLI_TEST_OUTPUT || result.directory;
59+
let { pkg } = this.project;
60+
61+
if (this.fastboot) {
62+
reloadServer(this.fastboot, distPath);
63+
} else {
64+
this.fastboot = createServer(distPath, pkg);
65+
}
6166
}
6267

6368
return result;

0 commit comments

Comments
 (0)