Skip to content
This repository was archived by the owner on Jul 21, 2023. It is now read-only.
Open
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ development:
api_key: # This is the Shopify API Key for your Private App
password: # This is the Shopify API password for your Private App
store: # This is the *.myshopify.com URL (e.g barrel.myshopify.com)
domain: # If Shopify has redirects to the primary domain enabled, put the domain here (e.g. barrelny.com)
local: # If you would like to use a local URL other than localhost, put it here (e.g. 10.0.1.8)
hmr: # If you would like to turn off hot module reloading, do so here (e.g. true or false)**

Expand Down
3 changes: 1 addition & 2 deletions lib/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class Configure {
store: '',
target: '',
hmr: true,
domain: false,
ignore: []
}, defaults)

Expand Down Expand Up @@ -99,7 +98,7 @@ class Configure {

checkProxyTarget () {
if (this.shopify) {
this.target = `https://${(this.domain || this.store)}`
this.target = `https://${this.store}`
console.log(`Proxy target set at ${this.target}`)
} else {
if (!this.target) {
Expand Down
12 changes: 12 additions & 0 deletions lib/watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ class Watcher {
return {
proxy: {
middleware: [
function (req, res, next) {
/**
* Shopify sites with redirection enabled for custom domains force redirection to that domain.
* ?_fd=0 prevents that forwarding.
* ?pb=0 hides the Shopify preview bar
* @type {string}
*/
const prefix = req.url.indexOf('?') > -1 ? '&' : '?'
const queryStringComponents = ['_fd=0&pb=0']
req.url += prefix + queryStringComponents.join('&')
next()
},
WDM(this.compiler, {
publicPath,
noInfo: true,
Expand Down