Add package run scripts to allow to run the webpack in watch mode, also

added '--progress' option to make it more interactive.
This commit is contained in:
Surinder Kumar 2017-08-25 17:24:46 +05:30 committed by Ashesh Vashi
parent 5dd375dd20
commit f711336a6b
2 changed files with 11 additions and 0 deletions

View File

@ -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",

View File

@ -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 ? [