tailwindcss-intellisense icon indicating copy to clipboard operation
tailwindcss-intellisense copied to clipboard

Doesn't work with ES Module syntax

Open AnzeKop opened this issue 1 year ago • 0 comments

What version of VS Code are you using? Latest

What version of Tailwind CSS IntelliSense are you using? Latest 0.10.5

What version of Tailwind CSS are you using? 3.3.2

What package manager are you using? Npm

What operating system are you using? Linux, macOS

Tailwind config import { fileURLToPath } from 'url'; const componentsDir = fileURLToPath(new URL('./components', import.meta.url));

export default { content: [${componentsDir}/**/*.{js,ts,jsx,tsx}], important: true, theme: { extend: {}, }, plugins: [], };

Describe your issue

[Error - 10:50:21 AM] Tailwind CSS: Cannot use 'import.meta' outside a module {directory}/tailwind.config.js:2 const componentsDir = _url.fileURLToPath.call(void 0, new URL('./components', import.meta.url)); ^^^^

SyntaxError: Cannot use 'import.meta' outside a module

Telling me that it doesn't support ES6 syntax. Converting the config to commonJS fixes this bug but the build pipeline forces me to use ES6.

AnzeKop avatar Feb 17 '24 09:02 AnzeKop