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

chore(deps): Update tailwind to 2.1 to natively support JIT #326

Merged
merged 6 commits into from
May 5, 2021

Conversation

RomainMazB
Copy link
Contributor

Hi there!

TailwindCSS team added the JIT mode to the core!

Some issues could probably resolve itself if we stop using the additional jit true/false config and let the process be more fluid #299, #298, #302 .

Since the JIT mode needs "a basic" purge config for now (an array referring files to watch instead of a object containing a content property), I also updated the documentation to make it clear that we need to override the default nuxtjs-tailwind purge config from this:

export default ({ _dev, rootDir, srcDir }) => ({
  purge: {
    content: [
      `${srcDir}/components/**/*.{vue,js}`,
      `${srcDir}/layouts/**/*.vue`,
      `${srcDir}/pages/**/*.vue`,
      `${srcDir}/plugins/**/*.{js,ts}`,
      `${rootDir}/nuxt.config.{js,ts}`
    ],
    // https://tailwindcss.com/docs/optimizing-for-production#purge-css-options
    options: {}
  }

to this:

export default {
  mode: 'jit',
  purge: [
    `~/components/**/*.{vue,js}`,
    `~/layouts/**/*.vue`,
    `~/pages/**/*.vue`,
    `~/plugins/**/*.{js,ts}`,
    `~~/nuxt.config.{js,ts}`
  ]
}

I would like to add some test for this, but I'm not so comfortable with Jest to analyze the javascript compilated file to expect the top-[12px] class to be present in it.

@codecov
Copy link

codecov bot commented Apr 7, 2021

Codecov Report

Merging #326 (e76f0f2) into main (42c23c8) will not change coverage.
The diff coverage is 100.00%.

❗ Current head e76f0f2 differs from pull request most recent head 93fda82. Consider uploading reports for the commit 93fda82 to get more accurate results
Impacted file tree graph

@@            Coverage Diff            @@
##              main      #326   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           37        41    +4     
  Branches         8         9    +1     
=========================================
+ Hits            37        41    +4     
Impacted Files Coverage Δ
src/index.ts 100.00% <100.00%> (ø)
src/tailwind.config.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 42c23c8...93fda82. Read the comment docs.

@RomainMazB RomainMazB changed the title Update tailwind to 2.1 to natively support JIT chore(deps): Update tailwind to 2.1 to natively support JIT Apr 7, 2021
Copy link

@viennv1709 viennv1709 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update src\index.ts to reflect changes

@RomainMazB
Copy link
Contributor Author

@atinux
Why this isn't merged yet? I'm not sure if some extra-work should be done from my side, I don't see any review to validate or what so ever but both git and NodeJS/TS are my friend.

@atinux atinux merged commit dfa989a into nuxt-modules:main May 5, 2021
@atinux
Copy link
Collaborator

atinux commented May 5, 2021

Updated and merged, thank you very much ❤️

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

Successfully merging this pull request may close these issues.

3 participants