Build configuration plugins
To create a build plugin
To define a before run script
{
"scandipwa": {
"type": "extension",
"build": {
"before": "build-config/composer.js"
}
},
...
}const fs = require('fs');
const path = require('path');
module.exports = () => {
const composerPath = path.join(process.cwd(), 'composer.json');
if (!fs.existsSync(composerPath)) {
console.log('The file "composer.json" should be present it the theme\'s root');
process.exit();
}
};Build plugin implementation syntax
Craco configuration plugin
Webpack configuration plugin
Webpack dev-server configuration plugin
Last updated