momocow/webpack-userscript

Error when using webpack config written in TypeScript

Opened this issue · 0 comments

I want to use a webpack config written in TypeScript in my project, but I get an error message if I remove UserscriptPlugin from the configuration, then everything works.

What could be the problem?

[webpack-cli] Failed to load 'C:\***\webpack.config.ts' config
[webpack-cli] TypeError: Unknown file extension ".ts" for C:\***\webpack.config.base.ts
     at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9)
     at defaultGetFormat (node:internal/modules/esm/get_format:203:36)
     at defaultLoad (node:internal/modules/esm/load:141:22)
     at async ModuleLoader.load (node:internal/modules/esm/loader:409:7)
     at async ModuleLoader.moduleProvider (node:internal/modules/esm/loader:291:45)
     at async link (node:internal/modules/esm/module_job:76:21) {
   code: 'ERR_UNKNOWN_FILE_EXTENSION'
}