question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slow nuxt build! what should I do?

See original GitHub issue

Without Tailwindcss

✔ Client
  Compiled successfully in 2.12m

✔ Server
  Compiled successfully in 1.72m


Hash: 36fc5cf6354758073391
Version: webpack 4.44.1
Time: 127192ms

With Tailwindcss

✔ Client
  Compiled successfully in 26.23s

✔ Server
  Compiled successfully in 7.20s


Hash: 2a16c82743dd11e56513
Version: webpack 4.44.1
Time: 26232ms

tailwindcss css

@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';

tailwindcss config js

const extend = {
  spacing: [-10, 200],
  inset: [0, 100],
  colors: {
    red: {
      default: '#FF3C3C',
      FFEEEE: '#FFEEEE',
    },
    blue: {
      default: '#5572FD',
      E8ECFF: '#E8ECFF',
    },
    green: '#50B349',
    yellow: {
      default: '#FF9807',
      FDC31F: '#FDC31F',
      FEF3E5: '#FEF3E5',
      FFE9D6: '#FFE9D6',
      FFEACC: '#FFEACC',
    },
    gray: {
      default: '#989898',
      656565: '#656565',
      F2F2F2: '#F2F2F2',
      E5E5E5: '#E5E5E5',
    },
  },
}

function expandThemeByPx (array) {
  const expand = {}
  const [start, end] = array
  let current = start
  while (current <= end) {
    expand[current] = `${current}px`
    current++
  }
  return expand
}

module.exports = {
  // important: true,
  future: {
    removeDeprecatedGapUtilities: true,
    purgeLayersByDefault: true,
    defaultLineHeights: true,
    standardFontWeights: true,
  },
  theme: {
    extend: {
      spacing: expandThemeByPx(extend.spacing),
      inset: expandThemeByPx(extend.inset),
      colors: extend.colors,
    },
    fill: extend.colors,
  },
  variants: {},
  plugins: [],
  purge: {
    // Learn more on https://tailwindcss.com/docs/controlling-file-size/#removing-unused-css
    enabled: process.env.NODE_ENV === 'production',
    content: [
      'src/components/**/*.vue',
      'src/layouts/**/*.vue',
      'src/pages/**/*.vue',
      'src/utils/common.js',
    ]
  }
}

nuxt config js

{
tailwindcss: {
    configPath: '~~/tailwind.config.js',
  },
}

HELP HELP

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:6

github_iconTop GitHub Comments

2reactions
productdevbookcommented, Apr 9, 2021

With the new version, if you use jit it is now fast JIT

@Atinux I think you should close here too.

2reactions
axelhzfcommented, Mar 9, 2021

I also found some performance problems migrating from tailwind 1.x to 2.x In my case, it was related to using @apply inside components.

I created this issue on the tailwind repo https://github.com/tailwindlabs/tailwindcss/issues/3717 and the following PR https://github.com/tailwindlabs/tailwindcss/pull/3718 . I am waiting for the tailwind team feedback

Read more comments on GitHub >

github_iconTop Results From Across the Web

Slow nuxt build! what should I do? · Issue #188 - GitHub
We are actually thinking of a way to accelerate the development build and hot module replacement, the idea would be to generate the...
Read more >
Nuxt build on locale is extremly slow - Stack Overflow
You can check your build and spot the bigger chunks, trying to selectively remove them ... Try this command: yarn nuxt build --analyze....
Read more >
Instantly speed up your Nuxt.js v2 build times - Reddit
I have a few Nuxt projects and they got painfully slow. This led me down a path of investigating what the latest build...
Read more >
Vue and Nuxt Performance Optimization Checklist
Read the comprehensive and in-depth technical article summarizing how to improve the site performance with efficient use of Vue.js and Nuxt.
Read more >
How to improve the PageSpeed score of your Nuxt.js website ...
To quickly inspect your dependency tree and identify some potential issues, you can run the nuxt build command with --analyze flag.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found