I have a question about building an NPM module with specific behavior. My goal is to have all dependencies work perfectly in the project once installed and imported.
Here's what I currently have:
https://i.sstatic.net/WZvME.png
In my "my-module" project, I have the desired dependency modules with their specific versions.
On the other hand, I have a project that imports these modules as shown below.
Within my project, I aim to write code like this and successfully run it:
import {Calendar} from 'primereact/calendar';
How can I address this issue?
Thank you in advance!
EDIT: The package.json for my project looks like this
{
"name": "my-project",
"version": "0.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "next src",
"build": "next build src",
"start": "next start src"
},
"license": "ISC",
"dependencies": {
"next": "^9.0.3",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"@ascope/my-module": "file://../my-module"
}
}
And the package.json for my-module:
{
"name": "my-module",
"version": "0.0.1",
"main": "index.js",
"scripts": {
"test": "exit 1"
},
"license": "ISC",
"bundledDependencies": [
"primereact",
"rxjs"
],
"dependencies": {
"primereact": "^3.1.8",
"rxjs": "^6.5.2"
},
"peerDependencies": {
"primereact": "^3.1.8",
"rxjs": "^6.5.2"
}
}