Skip to content

Commit

Permalink
fix(webpack): handle new https options in webpack-dev-server (#14520)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo authored Jan 20, 2023
1 parent 1c3ebfc commit da0e3ba
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
23 changes: 23 additions & 0 deletions e2e/web/src/web-webpack.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import {
cleanupProject,
newProject,
runCLI,
runCommandUntil,
uniq,
} from '@nrwl/e2e/utils';

describe('Web Components Applications with bundler set as webpack', () => {
beforeEach(() => newProject());
afterEach(() => cleanupProject());

it('should support https for dev-server', async () => {
const appName = uniq('app');
runCLI(
`generate @nrwl/web:app ${appName} --bundler=webpack --no-interactive`
);

await runCommandUntil(`serve ${appName} --port=5000 --ssl`, (output) => {
return output.includes('listening at https://localhost:5000');
});
}, 300_000);
});
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ function getDevServerPartial(
htmlAcceptHeaders: ['text/html', 'application/xhtml+xml'],
},
onListening(server: any) {
const isHttps =
server.options.https || server.options.server?.type === 'https';
logger.info(
`NX Web Development Server is listening at ${
server.options.https ? 'https' : 'http'
isHttps ? 'https' : 'http'
}://${server.options.host}:${server.options.port}${buildServePath(
buildOptions
)}`
Expand Down

0 comments on commit da0e3ba

Please sign in to comment.