UNPKG

zengenti-buildstartup-package

Version:

Post-build scripts to generate the startup scripts for any configured environments

38 lines (31 loc) 1.13 kB
# Zengenti Build Startup Package ## To use `npm i --save-dev zengenti-buildstartup-package` Then in your `webpack.config.prod.js` include a plugin to execute some post-build-scripts: ```javascript const WebpackShellPlugin = require('webpack-shell-plugin'); ``` ```javascript plugins: [ new WebpackShellPlugin({ onBuildEnd: [ 'echo "Executing Webpack post build scripts..."', 'node node_modules/zengenti-buildstartup-package', ], }), ] ``` Run your build as normal, you should see additional output in your build logs and scripts for each environment defined in `.env*` files in your project ``` /* buildStartup.js */ Found environment in: ".env" -- Created "dist/static/startup.js" -- Created "dist/server/start.js" -- Created "dist/server/start.council-cms.js" Found environment in: ".env.cambridgeshire" -- Created "dist/server/start.cambridgeshire.council-cms.js" Found environment in: ".env.peterborough" -- Created "dist/server/start.peterborough.council-cms.js" Deploying server start scripts buildStartup.js completed successfully ```