Skip to content

Commit

Permalink
Add ignored option for the devServer to fix infinite reloading from s…
Browse files Browse the repository at this point in the history
…ome plugins
  • Loading branch information
pqml committed Jan 24, 2018
1 parent 01f2412 commit 59c824f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 23 deletions.
49 changes: 27 additions & 22 deletions main.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,6 @@ const css = {
preprocessor: 'less'
}

/**
* DEVSERVER CONFIGURATION
*/
const devServer = {
// Port used by the dev server
port: 8080,

// Use this option if you already have a local environment (like MAMP)
// e.g. proxy: website.dev
// don't forget to rename config.localhost.php if you use a vhost
proxy: false,

// The alias/path to the php binary. OSX has PHP available natively.
// You have to edit this to have the devServer working on Windows.
// Use the proxy opt if you can't use / don't want to use a built-in php serv.
phpBinary: 'php',

// Set this to true to display PHP logs in your terminal
// /!\ does nothing if you use the `proxy` option
logPhpErrors: true
}

/**
* FOLDER ARCHITECTURE
* All paths used in kirby-webpack.
Expand Down Expand Up @@ -77,6 +55,33 @@ paths.kirby = {
widgets: path.join(paths.www, 'site', 'widgets')
}

/**
* DEVSERVER CONFIGURATION
*/
const devServer = {
// Port used by the dev server
port: 8080,

// Use this option if you already have a local environment (like MAMP)
// e.g. proxy: website.dev
// don't forget to rename config.localhost.php if you use a vhost
proxy: false,

// The alias/path to the php binary. OSX has PHP available natively.
// You have to edit this to have the devServer working on Windows.
// Use the proxy opt if you can't use / don't want to use a built-in php serv.
phpBinary: 'php',

// Set this to true to display PHP logs in your terminal
// /!\ does nothing if you use the `proxy` option
logPhpErrors: true,

// Force browserSync to not watch some specific files/folder
ignored: [
path.join(paths.kirby.plugins, 'page-lock')
]
}

// the appEnv variable can be used to create environment-specific behaviours
// By default, appEnv can be one of those three values:
// - development (via npm run start)
Expand Down
2 changes: 1 addition & 1 deletion scripts/webpack-serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function browserSyncInit () {
path.join(user.paths.www, 'site', 'cache', '**/*'),
path.join(user.paths.www, 'site', 'accounts', '**/*'),
path.join(user.paths.www, 'thumbs', '**/*')
]
].concat(user.devServer.ignored)
}
}, (error, instance) => {
if (error) throw error
Expand Down

0 comments on commit 59c824f

Please sign in to comment.