Skip to content

Mapped config.dev.https to devWebpackConfig.devServer (#1217) #1233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion template/build/webpack.dev.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const devWebpackConfig = merge(baseWebpackConfig, {
hot: true,
contentBase: false, // since we use CopyWebpackPlugin.
compress: true,
https: config.dev.https,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! We still have to add the actual property to /config/index.js file so people can know about the option's existance without studying the webpack files.

host: HOST || config.dev.host,
port: PORT || config.dev.port,
open: config.dev.autoOpenBrowser,
Expand Down Expand Up @@ -78,11 +79,13 @@ module.exports = new Promise((resolve, reject) => {
process.env.PORT = port
// add port to devServer config
devWebpackConfig.devServer.port = port
// which protocol to show in notifications
const protocol = devWebpackConfig.devServer.https ? 'https': 'http';

// Add FriendlyErrorsPlugin
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
compilationSuccessInfo: {
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
messages: [`Your application is running here: ${protocol}://${devWebpackConfig.devServer.host}:${port}`],
},
onErrors: config.dev.notifyOnErrors
? utils.createNotifierCallback()
Expand Down