Embarking on the journey of creating my inaugural library, I diligently followed a comprehensive guide. Utilizing rollup to consolidate all components and dependencies.
The conundrum that currently besets me is the perplexing error thrown by rollup regarding the resolution of my typings file. Despite my efforts, the exact cause of this issue eludes me. The error message in question reads as follows:
dist/esm/types/index.d.ts → dist/index.d.ts...
[!] RollupError: Could not resolve "../../../types/typings" from "dist/esm/types/components/CommentBase/interface.d.ts"
dist/esm/types/components/CommentBase/interface.d.ts
at error (C:\Users\Yanay\Documents\Coding\replyke\base\node_modules\rollup\dist\shared\rollup.js:284:30)
at ModuleLoader.handleInvalidResolvedId (C:\Users\Yanay\Documents\Coding\replyke\base\node_modules\rollup\dist\shared\rollup.js:24491:24)
at C:\Users\Yanay\Documents\Coding\replyke\base\node_modules\rollup\dist\shared\rollup.js:24453:26
This excerpt showcases my package.json configuration:
{
"name": "@replyke/base",
"version": "1.0.0",
"description": "",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
...
In addition, here is an insight into my rollup.config.js setup:
const resolve = require("@rollup/plugin-node-resolve");
const commonjs = require("@rollup/plugin-commonjs");
const typescript = require("@rollup/plugin-typescript");
const dts = require("rollup-plugin-dts");
const packageJson = require("./package.json");
...
Furthermore, let's delve into my tsconfig.json
configuration:
{
"compilerOptions": {
"target": "es2016",
"jsx": "react",
...
To add more context, the types/typings.d.ts
directory and file are present within my src folder, functioning seamlessly except during the building process with rollup.