lasso-js/lasso

Prebuilding takes up to 3 min for a regular sized project.

Opened this issue · 2 comments

Hi, I'm using markojs and lasso. It works great together but building a marko website with ~13 pages and ~25 components takes up to 3 minutes on a good machine AMD Ryzen 5 2600X (12) @ 3.600G, SSD.

'use strict';

const { run } = require('@marko/prebuild');
const globby = require('globby');
const lassoConfig = require('./src/lasso-config');

async function prebuild() {
  const paths = await globby(['src/pages/*/*.marko']);
  await run({
    config: lassoConfig, // Either a lasso config object, or a path to one.
    flags: [], // Lasso flags to use when building the pages.
    pages: paths
  });
  // All templates have their prebuild.json files written to disk.
  console.log('Prebuild completed!');
}

prebuild().catch(err => {
  throw err;
});

Are you aware of that? How can we improve it?

@StarpTech I'm curious what the build time is when you disable the lasso-babel-transform if that is possible in your setup. If not then perhaps only enabling the bare minimum transforms.

I have a feeling that babel might be the bottleneck here and if so a solution may be better caching (or excluding node_modules if that works for you). The [webpack babel loader](babel-loader webpack) comes which caching, so maybe we should do something similar.

Hi @DylanPiercey thank your for the tips. I tried several things like reduce the babel plugins, exclude node_modules, disable minifying, removing autoprefixer it takes always 48 seconds on my machine or around 2min on a small EC2 instance. Based on the setup this is huge.