diff --git a/web/package.json b/web/package.json index 8e7fee341..865f6206e 100644 --- a/web/package.json +++ b/web/package.json @@ -86,9 +86,11 @@ "scripts": { "linter": "yarn run eslint pgadmin/static/jsx/**/*.jsx pgadmin/static/js/selection/*.js regression/javascript/**/*.jsx regression/javascript/**/*.js *.js", "webpacker": "yarn run webpack -- --config webpack.config.js", + "webpacker:watch": "yarn run webpack -- --config webpack.config.js --progress --watch", "webpacker:dev": "yarn run webpack -- --config webpack.config.js", "webpacker:prod": "yarn run linter && yarn run webpack -- --config webpack.config.js", "bundle": "yarn run linter && yarn run webpacker", + "bundle:watch": "yarn run linter && yarn run webpacker:watch", "bundle:dev": "yarn run linter && yarn run webpacker:dev", "bundle:prod": "cross-env NODE_ENV=production yarn run webpacker:prod", "test:karma-once": "yarn run linter && yarn run karma start -- --single-run", diff --git a/web/webpack.config.js b/web/webpack.config.js index edf6693f0..a2587fe3c 100644 --- a/web/webpack.config.js +++ b/web/webpack.config.js @@ -296,6 +296,15 @@ module.exports = { extensions: ['.js', '.jsx'], unsafeCache: true, }, + // Watch mode Configuration: After initial build, webpack will watch for + // changes in files and compiles only files which are changed, + // if watch is set to True + // Reference: https://webpack.js.org/configuration/watch/#components/sidebar/sidebar.jsx + watchOptions: { + aggregateTimeout: 300, + poll: 1000, + ignored: /node_modules/, + }, // Define list of Plugins used in Production or development mode // Ref:https://webpack.js.org/concepts/plugins/#components/sidebar/sidebar.jsx plugins: PRODUCTION ? [