this is my declarations file
declare module '*.css'
and this is the code I'm trying to run
import css from "./data/style.css"
const style = document.createElement("style");
style.innerHTML = css;
document.head.append(style);
this is my tsconfig
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Bundler",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
},
"include": [
"./src/**/*",
"./**/*.css",
],
}
this is my build command
"esbuild --bundle ./src/index.ts --outfile=index.js --format=esm --watch --loader:.css=text"
for some reason I get
src/index.ts:1:16:
1 │ import css from "./data/style.css"
╵ ~~~~~~~~~~~~~~~~~~