lasso-js / lasso

Advanced JavaScript module bundler, asset pipeline and optimizer
581 stars 75 forks source link

Lasso/Marko production mode #196

Closed juliocanares closed 6 years ago

juliocanares commented 7 years ago

Hi guys. I’ve been working a lot with Marko those days that I am now have so many pages using it.

I have a problem with that, since I am using warmup my deployment process has gotten too slow(it takes minutes to warmup) and it usually makes my process manager to run out of memory.

I would like to know if there is a way to make all that process before deployment.

another issue I am having is that I can’t hit any page using warmup that is blocked by credentials like the /onboard , /checkout, /account pages.

I already tried using lasso to generate the bundle and cacheProfile in the lasso config

lasso ./src/views/pages/home/browser.json --name home -c lasso-config.json --production
require('lasso').configure({
  cacheProfile: 'production',
  bundleReadTimeout: 120000,
  bundlingEnabled: isProduction,
  plugins: [
    {
      plugin: 'lasso-less',
      config: {
        extensions: ['less'],
        lessConfig: {
          strictMath: true,
          strictUnits: true
        }
      }
    },
    'lasso-autoprefixer',
    'lasso-marko'
  ],
  outputDir: 'public',
  urlPrefix: '/public',
  minify: isProduction,
  fingerprintsEnabled: isProduction
});
schetnikovich commented 7 years ago

@juliocanares I'm also looking for some good solution for this problem. Please check third-party repository: lasso-marko-extras. It uses Lasso & Marko API to generate all static assets. Example of usage is in the test/site folder.

Key Lasso and Marko APIs are:

  1. lasso.lassoResource()
  2. lasso.lassoPage()
  3. template.getDependencies()

There is a similar question from my side How to generate all static assets for the whole app?

juliocanares commented 7 years ago

@schetnikovich I will take a look :D