I am currently in the process of developing a TypeScript and Webpack-based library.
To facilitate the development of this library, I have set up a separate test project (written in JS) and connected the library using npm link <package-name>
.
However, I am facing an issue where the linked file directs to the build version, requiring me to execute npm run build
each time I make changes.
Is there a way for me to establish a link to the source file with live reloading capabilities? Would rewriting my test project in TS be necessary to achieve this?
The library's package.json
:
{
...
"main": "lib/qr-code-styling.js",
"files": [
"lib"
],
"scripts": {
"build": "webpack --mode=production"
},
...
}
Explore the code of the library at https://github.com/kozakdenys/qr-code-styling/tree/v1
Check out the code of the test project at https://github.com/kozakdenys/qr-code-styling-site
P.S. I attempted using "module": "src/index.ts"
in package.json
, but it resulted in an error in the test project stating:
Uncaught Error: Cannot find module './core/QRCodeStyling'