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: add utils to default content path #641

Merged
merged 2 commits into from
Mar 21, 2023
Merged

Conversation

manniL
Copy link
Contributor

@manniL manniL commented Mar 20, 2023

As utils are also auto-imported, it should be added to the default content path for the TailwindCSS module.

@nuxt-studio
Copy link

nuxt-studio bot commented Mar 21, 2023

Live Preview ready!

Name Edit Preview Latest Commit
TailwindCSS Edit on Studio ↗︎ View Live Preview 83d50d3

@Atinux Atinux merged commit de2e45d into nuxt-modules:main Mar 21, 2023
Copy link
Collaborator

Atinux commented Mar 21, 2023

Thanks!

@manniL manniL deleted the patch-1 branch March 21, 2023 09:51
@ineshbose
Copy link
Collaborator

It just came to my mind about the directory configuration for a Nuxt project and how layerPaths could adapt. This is my scribble but it could be challenging (for eg, dir could include tilde ~, so path may not be valid) - but having something implemented would be cool!

const layerPaths = ({ srcDir, components, imports, dir }: NuxtOptions | NuxtConfig) => ([
  // components
  ...(typeof components === 'object' ?
       (Array.isArray(components) ?
           components.map(c => `${srcDir}/${typeof c === 'string' ? c : c?.path || 'components'}/**/*.{${typeof c === 'object' ? c.extensions?.join() || 'vue,js,ts' : 'vue,js,ts'}}`)
           : (components.dirs || []))
       : []),

  // layouts, pages, plugins
  `${srcDir}/${dir?.layouts}/**/*.vue`,
  `${srcDir}/${dir?.pages}/**/*.vue`,
  `${srcDir}/${dir?.plugins}/**/*.{js,ts}`,

  // composables, utils
  ...((imports?.dirs || []).map(d => `${srcDir}/${d}/*.{js,ts}`)),

  `${srcDir}/App.{js,ts,vue}`,
  `${srcDir}/app.{js,ts,vue}`,
  `${srcDir}/Error.{js,ts,vue}`,
  `${srcDir}/error.{js,ts,vue}`
])

Copy link
Collaborator

Atinux commented Mar 21, 2023

It could be a nice improvement indeed

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.

None yet

3 participants