I’m noticing a significant difference in compile time between Laravel Mix & Bud (in development mode).
A change in a scss file:
Laravel mix: 3.8s
Bud: 5.9s
Both times, I’m importing all bootstrap files in both app.scss & editor.scss. Is there any way I can speed up this compile time?
/**
* @typedef {import('@roots/bud').Bud} bud
*
* @param {bud} app
*/
module.exports = async (app) => {
app
/**
* Application entrypoints
*
* Paths are relative to your resources directory
*/
.entry({
app: ['@scripts/app', '@styles/app'],
editor: ['@scripts/editor', '@styles/editor'],
})
.when(app.isProduction, app => {
app.purgecss({
enabled: false,
content: [
app.path('project', 'resources/views/**/*.blade.php'),
app.path('project', 'app/**/*.php'),
app.path('project', 'index.php'),
],
safelist: require('purgecss-with-wordpress').safelist.concat(require('./purge-safelist').safelist),
})
})
/**
* These files should be processed as part of the build
* even if they are not explicitly imported in application assets.
*/
.assets(['images'])
/**
* These files will trigger a full page reload
* when modified.
*/
.watch('resources/views/**/*', 'app/**/*')
/**
* Target URL to be proxied by the dev server.
*
* This is your local dev server.
*/
.proxy('https://example.text');
};
Doesn’t look like you’re doing any sort of linting? If you remove all of the linting from your theme (example), what change does that have on your build times?
I tested without linting, there might be a small difference, but it is not noticable. If you would like to investigate this a little further, I created a branch which contain both ways to compile.
You can just clone the branch, run yarn & switch between mix & bud (see README.md).
Running yarn build is indeed faster with bud (2.35s) vs mix (4.03s). I’m talking about development (yarn dev & yarn dev-mix), and how fast the changes are reflected in my browser.