Skip to content

Commit

Permalink
feat(server): add snippet options to browser-sync
Browse files Browse the repository at this point in the history
This will make sure WordPress REST API End-points and admin-ajax
calls are rewritten with new URL.

Fixes #155
  • Loading branch information
swashata committed Feb 12, 2019
1 parent 6261073 commit b518511
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/scripts/src/scripts/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ export class Server {
host: this.serverConfig.host,
open: false, // We don't want to open right away
notify: this.serverConfig.notify,
snippetOptions: {
whitelist: [
// Add WP REST API
'/wp-json/**',
// Add AJAX calls
'/wp-admin/admin-ajax.php',
],
},
};
if (this.serverConfig.bsOverride) {
bsOptions = {
Expand Down

0 comments on commit b518511

Please sign in to comment.