updated webpack dev build to run 'drush cc css-js'

This commit is contained in:
Bachir Soussi Chiadmi 2022-08-10 14:49:59 +02:00
parent 44df557f29
commit 75ea440f89
3 changed files with 22 additions and 1 deletions

View File

@ -5,6 +5,7 @@ const { merge } = require('webpack-merge')
const baseConfig = require('./webpack.config.base')
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const WebpackShellPluginNext = require('webpack-shell-plugin-next');
module.exports = merge(baseConfig, {
mode: 'development',
@ -51,6 +52,19 @@ module.exports = merge(baseConfig, {
// new webpack.HotModuleReplacementPlugin()
new BundleAnalyzerPlugin({
'analyzerMode': 'static'
}),
new WebpackShellPluginNext({
// onBuildStart:{
// scripts: ['echo "Webpack Start"'],
// blocking: true,
// parallel: false
// },
// drush is not installed in this container so we have to ssh on the php container
onAfterDone:{
scripts: ['echo "Clearing drupal cache $USER_UNAME $DRUPAL_ROOT"', 'sshpass -p "$USER_UNAME" ssh $USER_UNAME@php "cd $DRUPAL_ROOT && drush cc css-js"', 'echo "Done"'],
blocking: true,
parallel: false
}
})
]
})

6
package-lock.json generated
View File

@ -11351,6 +11351,12 @@
"wildcard": "^2.0.0"
}
},
"webpack-shell-plugin-next": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/webpack-shell-plugin-next/-/webpack-shell-plugin-next-2.2.2.tgz",
"integrity": "sha512-2HeC1e0cCvTgA3SD4XPAD69DnILM92mCschrtKdlLRORHCR+oG7xnibQMkVySxTAYWTQOcBRHlqa88x4syWwhQ==",
"dev": true
},
"webpack-sources": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz",

View File

@ -88,6 +88,7 @@
"webpack-bundle-analyzer": "^4.4.0",
"webpack-cli": "^4.2.0",
"webpack-extraneous-file-cleanup-plugin": "^2.0.0",
"webpack-merge": "^5.4.0"
"webpack-merge": "^5.4.0",
"webpack-shell-plugin-next": "^2.2.2"
}
}