typescript 无法在Remix.js项目中导入顺风css文件而不引发TS错误

c8ib6hqw  于 7个月前  发布在  TypeScript
关注(0)|答案(1)|浏览(62)


的数据
我已经试着按照here的答案,但它仍然不工作
以下是我的评论:
remix.config.ts

/** @type {import('@remix-run/dev').AppConfig} */
module.exports = {
  postcss: true,
  tailwind: true,
}

字符串
tailwind.config.ts

import type { Config } from 'tailwindcss'

export default {
  content: ['./app/**/*.{js,jsx,ts,tsx}'],
  theme: {
    extend: {},
  },
  plugins: [],
} satisfies Config

z2acfund

z2acfund1#

我使用的是Remix 2.3版,我的tsconfig.json文件看起来像这样

{
  "include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
  "compilerOptions": {
    "lib": ["DOM", "DOM.Iterable", "ES2022"],
    "isolatedModules": true,
    "esModuleInterop": true,
    "jsx": "react-jsx",
    "resolveJsonModule": true,
    "module": "ES2022",
    "moduleResolution": "Bundler",
    "baseUrl": ".",
    "noEmit": true,
    "paths": {
      "~/*": ["./app/*"]
    }
  }
}

字符串
ModuleModuleResolution是您需要确保拥有的项目。

相关问题