This is a classic WordPress theme boilerplate with a Gulp build process including customized Bootstrap 5. Assumes a single entry and output point for both CSS and JavaScript, so requires additional configuration if you need to serve in a more component-driven style with multiple entry/output.
-
Place source files in a theme folder on your WordPress install.
-
Navigate via terminal to the theme folder and run
npm ito install dependencies. -
Install Gulp CLI.
If you don't already have Gulp CLI installed globally, you can install it via
npm i --global gulp-cli. -
Update the proxy URL in gulpfile.js in the
servefunction to the local URL for your site. -
To start the dev build process, either run the command
gulpor use thedevcommand script inpackage.json(npm run dev). Both of these run the default gulp task which compiles, auto-prefixes, and minifies the Sass files, transpiles and minifies the JavaScript, and starts a Browsersync server which reloads the page on file change.Note: source maps are only generated for development.
To build for production, run the command
gulp build --production, ornpm run prodfor production-ready CSS and JavaScript.
Include specific component styles in assets/scss/bootstrap/custom.scss. Be aware there are dependencies across
components. Refer to Bootstrap's Sass documentation for
more details on customization options.
If a component has required JavaScript, import in assets/js/app.js.
- Run
gulp --tasksto see available gulp tasks