Struggling to integrate my custom library with TypeScript and Webpack. Import errors are causing headaches, despite smooth sailing in CLion.
Running tsc
within the project directory is error-free, unlike when running npm run dev
in the examples/webpack directory with webpack scripts.
Webpack output includes import errors for various typescript files without extensions and missing 'fs' module from zlib-asm's Module.js in node_modules.
Project structure includes example/webpack/ with index.tsx, h.ts, package.json, and tsconfig.json along side src/index.ts and corresponding config files.
The webpack.config.js file sets up TypeScript loading rules and outputs script.js while tsconfig.json specifies compiler options including jsxFactory as 'h'.
The issue arises from importing code in example/webpack/index.tsx using "../../".
In package.json, the main file is set to be src/index.ts.