diff --git a/src/module.ts b/src/module.ts index 77bd0398..f153e0d8 100644 --- a/src/module.ts +++ b/src/module.ts @@ -153,7 +153,7 @@ export default defineNuxtModule({ if (moduleOptions.editorSupport || moduleOptions.addTwUtil || isNuxt2()) { const editorSupportConfig = resolveEditorSupportConfig(moduleOptions.editorSupport) - if (editorSupportConfig.autocompleteUtil || moduleOptions.addTwUtil) { + if ((editorSupportConfig.autocompleteUtil || moduleOptions.addTwUtil) && !isNuxt2()) { addImports({ name: 'autocompleteUtil', from: resolve('./runtime/utils'), diff --git a/src/resolvers.ts b/src/resolvers.ts index ebc85d60..062cc999 100644 --- a/src/resolvers.ts +++ b/src/resolvers.ts @@ -67,14 +67,14 @@ export const resolveModulePaths = async (configPath: ModuleOptions['configPath'] if (Array.isArray(nuxt.options._layers) && nuxt.options._layers.length > 1) { const layerPaths = await Promise.all( - nuxt.options._layers.slice(1).reverse().map(async (layer): Promise<[string[], string[]]> => ([ + nuxt.options._layers.slice(1).map(async (layer): Promise<[string[], string[]]> => ([ await resolveConfigPath(layer?.config?.tailwindcss?.configPath || join(layer.cwd, 'tailwind.config')), resolveContentPaths(layer?.config?.srcDir || layer.cwd, defu(layer.config, nuxt.options) as typeof nuxt.options) ]))) layerPaths.forEach(([configPaths, contentPaths]) => { - mainPaths[0].push(...configPaths) - mainPaths[1].push(...contentPaths) + mainPaths[0].unshift(...configPaths) + mainPaths[1].unshift(...contentPaths) }) } diff --git a/src/types.ts b/src/types.ts index ee7f272c..4d824d6b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -53,7 +53,7 @@ export type EditorSupportConfig = { /** * Enable utility to write Tailwind CSS classes inside strings. * - * You will need to update `.vscode/settings.json` based on this value. + * You will need to update `.vscode/settings.json` based on this value. This works only for Nuxt 3 or Nuxt 2 with Bridge. * * ```json * {