diff --git a/README.md b/README.md index 14f71eb..064193f 100644 --- a/README.md +++ b/README.md @@ -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)** diff --git a/lib/configure.js b/lib/configure.js index 5f078a1..e092d57 100644 --- a/lib/configure.js +++ b/lib/configure.js @@ -27,7 +27,6 @@ class Configure { store: '', target: '', hmr: true, - domain: false, ignore: [] }, defaults) @@ -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) { diff --git a/lib/watcher.js b/lib/watcher.js index d7c9a4c..6d282f0 100644 --- a/lib/watcher.js +++ b/lib/watcher.js @@ -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,