Skip to content

Commit

Permalink
Merge pull request #22 from jp-albrecht/issue-18-webpack-config
Browse files Browse the repository at this point in the history
refactor: add ssl prompt in setup script
  • Loading branch information
saltnpixels committed Mar 17, 2021
2 parents 5461a68 + bba0e4d commit 8ad6e6a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
20 changes: 18 additions & 2 deletions replace.config.js
Expand Up @@ -66,6 +66,11 @@ const questions = [
name: 'server',
message: 'Development or Remote Url',
initial: 'ignition.local'
},
{
type: 'confirm',
name: 'ssl',
message: 'Does your local server have an SSL?',
}
];

Expand Down Expand Up @@ -119,8 +124,19 @@ const questions = [
files: './theme.config.json',
dry: args['dry'] || false,
verbose: true,
from: [/"name": ".*/g, /"slug": ".*/g, /"server": ".*/g],
to: [`"name": "${response.name}",`, `"slug": "${response.slug}",`, `"server": "${response.server}",`]
from: [
/"name": ".*/g,
/"slug": ".*/g,
/"server": ".*/g,
/"ssl": .*/g,
]
,
to: [
`"name": "${response.name}",`,
`"slug": "${response.slug}",`,
`"server": "${response.server}",`,
`"ssl": ${response.ssl},`
]
}

try {
Expand Down
1 change: 1 addition & 0 deletions theme.config.json
Expand Up @@ -2,6 +2,7 @@
"name": "Ignition",
"slug": "ignition",
"server": "ignition.local",
"ssl": false,
"google_fonts": [
"Roboto:400,400i,700,700i",
"Roboto Slab:400,700"
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Expand Up @@ -93,7 +93,7 @@ module.exports = {
new MiniCssExtractPlugin(),
new BrowserSyncPlugin({
host: themeConfig.server,
proxy: `https://${themeConfig.server}`,
proxy: `${themeConfig.ssl ? 'https' : 'http'}://${themeConfig.server}`,
https: true,
files: [
'**/*.php',
Expand Down

0 comments on commit 8ad6e6a

Please sign in to comment.