mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-14 20:03:33 +01:00
Merge pull request #189 from orangemug/feature/disable-polling-by-default
Disable polling by default
This commit is contained in:
commit
97dbb74486
3 changed files with 14 additions and 3 deletions
|
@ -49,7 +49,12 @@ npm install
|
||||||
npm start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
Build a production package for distribution.
|
The build process will watch for changes to the filesystem, rebuild and autoreload the editor. However note this from the webpack-dev-server docs
|
||||||
|
|
||||||
|
> webpack uses the file system to get notified of file changes. In some cases this does not work. For example, when using Network File System (NFS). Vagrant also has a lot of problems with this.
|
||||||
|
Snippet from <https://webpack.js.org/configuration/dev-server/#devserver-watchoptions->
|
||||||
|
|
||||||
|
To enable polling add `export WEBPACK_DEV_SERVER_POLLING=1` to your enviroment.
|
||||||
|
|
||||||
```
|
```
|
||||||
npm run build
|
npm run build
|
||||||
|
|
|
@ -41,7 +41,13 @@ module.exports = {
|
||||||
// serve index.html in place of 404 responses to allow HTML5 history
|
// serve index.html in place of 404 responses to allow HTML5 history
|
||||||
historyApiFallback: true,
|
historyApiFallback: true,
|
||||||
port: PORT,
|
port: PORT,
|
||||||
host: HOST
|
host: HOST,
|
||||||
|
watchOptions: {
|
||||||
|
// Disabled polling by default as it causes lots of CPU usage and hence drains laptop batteries. To enable polling add WEBPACK_DEV_SERVER_POLLING to your environment
|
||||||
|
// See <https://webpack.js.org/configuration/watch/#watchoptions-poll> for details
|
||||||
|
poll: (!!process.env.WEBPACK_DEV_SERVER_POLLING ? true : false),
|
||||||
|
watch: false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.NoErrorsPlugin(),
|
new webpack.NoErrorsPlugin(),
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
"build": "webpack --config config/webpack.production.config.js --progress --profile --colors",
|
"build": "webpack --config config/webpack.production.config.js --progress --profile --colors",
|
||||||
"test": "wdio config/wdio.conf.js",
|
"test": "wdio config/wdio.conf.js",
|
||||||
"test-watch": "wdio config/wdio.conf.js --watch",
|
"test-watch": "wdio config/wdio.conf.js --watch",
|
||||||
"start": "webpack-dev-server --progress --profile --colors --watch-poll --config config/webpack.config.js",
|
"start": "webpack-dev-server --progress --profile --colors --config config/webpack.config.js",
|
||||||
"lint": "eslint --ext js --ext jsx {src,test}",
|
"lint": "eslint --ext js --ext jsx {src,test}",
|
||||||
"lint-styles": "stylelint 'src/styles/*.scss'"
|
"lint-styles": "stylelint 'src/styles/*.scss'"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue