在 aurelia 打字稿 webpack 开发设置中提供 https
Serving https in aurelia typescript webpack dev setup
当我 运行 au run
以便应用程序使用 https 而不是 http 时,我需要使用 https://localhost:8080
来测试开发中的 facebook 登录。
当前设置使用从 au new
创建的标准 aurelia+typescript+webpack 骨架。
我在 webpack.config.js 的 devServer 字段中添加了 https: true
,但它不起作用。 https://webpack.js.org/configuration/dev-server/#devserver-https。我需要为 Aurelia 做些特别的事吗?
似乎是 run.ts
任务中的疏忽。 https
属性 未被复制。
如果您进行此修改,它应该可以工作:
function runWebpack(done) {
// https://webpack.github.io/docs/webpack-dev-server.html
let opts = {
host: 'localhost',
publicPath: config.output.publicPath,
filename: config.output.filename,
hot: project.platform.hmr || CLIOptions.hasFlag('hmr'),
port: project.platform.port,
contentBase: config.output.path,
historyApiFallback: true,
open: project.platform.open,
stats: {
colors: require('supports-color')
},
https: config.devServer.https // add this line
}
我提交了一个 PR 应该可以解决这个问题。
当我 运行 au run
以便应用程序使用 https 而不是 http 时,我需要使用 https://localhost:8080
来测试开发中的 facebook 登录。
当前设置使用从 au new
创建的标准 aurelia+typescript+webpack 骨架。
我在 webpack.config.js 的 devServer 字段中添加了 https: true
,但它不起作用。 https://webpack.js.org/configuration/dev-server/#devserver-https。我需要为 Aurelia 做些特别的事吗?
似乎是 run.ts
任务中的疏忽。 https
属性 未被复制。
如果您进行此修改,它应该可以工作:
function runWebpack(done) {
// https://webpack.github.io/docs/webpack-dev-server.html
let opts = {
host: 'localhost',
publicPath: config.output.publicPath,
filename: config.output.filename,
hot: project.platform.hmr || CLIOptions.hasFlag('hmr'),
port: project.platform.port,
contentBase: config.output.path,
historyApiFallback: true,
open: project.platform.open,
stats: {
colors: require('supports-color')
},
https: config.devServer.https // add this line
}
我提交了一个 PR 应该可以解决这个问题。