When I use a dts.config.ts (Typescript version of the config file) with the following contents (same as in the example in the readme):
import { defineConfig } from 'dts-cli';
export default defineConfig({
// This function will run for each entry/format/env combination
rollup: (config, options) => {
return config; // always return a config.
},
});
I get the following error when running npm run build (dts build):
Error: Cannot find module 'dts-cli'
Require stack:
- /Users/lukasbals/treely/strapi-slices/dts.config.ts
- /Users/lukasbals/treely/strapi-slices/node_modules/dts-cli/dist/createBuildConfigs.js
- /Users/lukasbals/treely/strapi-slices/node_modules/dts-cli/dist/index.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/Users/lukasbals/treely/strapi-slices/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
at Function.Module._load (node:internal/modules/cjs/loader:922:27)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at require (node:internal/modules/cjs/helpers:119:18)
at Object.<anonymous> (/Users/lukasbals/treely/strapi-slices/dts.config.ts:1:1)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module.m._compile (/Users/lukasbals/treely/strapi-slices/node_modules/ts-node/src/index.ts:1618:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Object.require.extensions.<computed> [as .ts] (/Users/lukasbals/treely/strapi-slices/node_modules/ts-node/src/index.ts:1621:12)
Current Behavior
When I use a
dts.config.ts
(Typescript version of the config file) with the following contents (same as in the example in the readme):I get the following error when running
npm run build
(dts build
):Expected behavior
The build starts.
Suggested solution(s)
-
Additional context
-
Your environment