#Can't import tailwind config
11 messages · Page 1 of 1 (latest)
you can't use import syntax in/with a commonjs (.cjs) file
try renaming the files to .mjs (esm modules) or .ts (for typescript)
I'm still getting the same error with both file extensions
with the error now mentioning the new file extension?
can I see the config?
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/**/*.astro'],
theme: {
extend: {},
fontFamily: {
sans: ['Roboto'],
},
},
plugins: [],
};
This should work for .ts. since cjs doesn't allow imports, it's probably easier this way round
import type { Config } from 'tailwindcss'
const config: Config {
content: ['./src/**/*.astro'],
theme: {
extend: {},
fontFamily: {
sans: ['Roboto'],
},
},
plugins: [],
}
export default config;
thank you that worked :)