Skip to content

Commit

Permalink
Added warn msg to terminal output when user changed bundle options (#731
Browse files Browse the repository at this point in the history
)
  • Loading branch information
TMaszko authored Apr 30, 2020
1 parent b6a89b7 commit 7e23577
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('packager server', () => {

expect(responseAfterBundleOptionsChanged.status).toBe(501);
expect(minifiedSecondBundle.toString()).toBe(
'To see the changes you need to restart the haul server'
'Changing query params after the bundle has been created is not supported. To see the changes you need to restart the Haul server.'
);

stopServer(instance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('packager server', () => {

expect(responseAfterBundleOptionsChanged.status).toBe(501);
expect(minifiedSecondBundle.toString()).toBe(
'To see the changes you need to restart the haul server'
'Changing query params after the bundle has been created is not supported. To see the changes you need to restart the Haul server.'
);

stopServer(instance);
Expand Down
7 changes: 4 additions & 3 deletions packages/haul-core/src/server/setupCompilerRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@ export default function setupCompilerRoutes(
);

if (isUserChangedOptions) {
return h
.response('To see the changes you need to restart the haul server')
.code(501);
const warnMsg =
'Changing query params after the bundle has been created is not supported. To see the changes you need to restart the Haul server.';
runtime.logger.warn(warnMsg);
return h.response(warnMsg).code(501);
}

if (areBundleOptionsSet(bundleOptionsFromQuery)) {
Expand Down

0 comments on commit 7e23577

Please sign in to comment.