diff --git a/global.d.ts b/global.d.ts new file mode 100644 index 00000000..032af2ed --- /dev/null +++ b/global.d.ts @@ -0,0 +1,23 @@ +/** + * @module global + */ + +/// + +// see nextConfig.webpack in next.config.ts for non-standard "asset/resource" module rules. +// https://webpack.js.org/guides/typescript/#importing-other-assets + +declare module "*.mp4" { + const src: string; + export default src; +} + +declare module "*.webm" { + const src: string; + export default src; +} + +declare module "*.vtt" { + const src: string; + export default src; +} diff --git a/next.config.ts b/next.config.ts index 4d718235..60b31e21 100644 --- a/next.config.ts +++ b/next.config.ts @@ -30,7 +30,7 @@ const nextConfig: NextConfig = { ], }, outputFileTracingExcludes: { - "*": ["./public/**/*", "**/*.mp4", "**/*.webm"], + "*": ["./public/**/*", "**/*.mp4", "**/*.webm", "**/*.vtt"], }, webpack: (config) => { config.module.rules.push({ diff --git a/tsconfig.json b/tsconfig.json index 32c43fc1..916b560e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,6 +19,6 @@ } ] }, - "include": ["next-env.d.ts", "webpack.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "include": ["next-env.d.ts", "global.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "exclude": ["node_modules"] } diff --git a/webpack.d.ts b/webpack.d.ts deleted file mode 100644 index f69ff3d3..00000000 --- a/webpack.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -declare module "*.mp4" { - const src: string; - export default src; -} - -declare module "*.webm" { - const src: string; - export default src; -} - -declare module "*.vtt" { - const src: string; - export default src; -}