Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
StarpTech opened this issue Apr 1, 2019 · 2 comments
Open

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

StarpTech opened this issue Apr 1, 2019 · 2 comments

Comments

@StarpTech
Copy link
Contributor

StarpTech commented Apr 1, 2019

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 StarpTech changed the title Build takes up to 3min for a regular sized project. Prebuilding takes up to 3 min for a regular sized project. Apr 1, 2019
@DylanPiercey
Copy link
Contributor

DylanPiercey commented Apr 1, 2019

@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.

@StarpTech
Copy link
Contributor Author

StarpTech commented Apr 1, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants