Introducing a new npm package called leon-theme. You can find it on npm at this link: https://www.npmjs.com/package/leon-theme
For the source code, head over to Github here: https://github.com/leongaban/leon-theme
After running npm run build
locally in the custom package, the dist folder is generated correctly. However, upon publishing, all files except for README and package.json seem to be missing.
This issue results in not being able to import the new package into a fresh react app as the module cannot be found.
tsconfig Configuration:
{
"compilerOptions": {
"module": "ES6",
"target": "es2016",
"lib": ["ES2020", "DOM"],
"jsx": "react",
"declaration": true,
"declarationDir": "types",
"sourceMap": true,
"allowSyntheticDefaultImports": true,
"noEmit": false,
"outDir": "./dist/lib/es6",
"moduleResolution": "node"
},
"include": ["src/**/*"]
}
Main package.json Configuration:
{
"name": "leon-theme",
"version": "1.0.0",
"module": "lib/es6/index.js",
"description": "A simple React style & component library",
"scripts": {
"build": "rm -rf dist/lib && tsc --build"
},
"author": "Leon Gaban",
"license": "ISC",
"dependencies": {
"react": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.2.22",
"jest-environment-jsdom": "^29.7.0",
"tslib": "^2.6.2",
"typescript": "^5.2.2"
},
"files": [
"dist"
],
"types": "dist/index/.d.ts"
}
Package.json Configuration within the 'dist' Folder:
{
"name": "leon-theme",
"version": "0.0.6",
"module": "lib/es6/index.js",
"description": "A simple React style & component library",
"homepage": "https://github.com/leongaban/leon-theme",
"bugs": {
"url": "https://github.com/leongaban/leon-theme/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/leongaban/leon-theme.git"
},
"keywords": [
"javascript",
"theme",
"buttons",
"leon"
],
"scripts": {
"build": "rm -rf dist/lib && tsc --build"
},
"author": "Leon Gaban",
"license": "ISC",
"dependencies": {
"react": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.2.22",
"jest-environment-jsdom": "^29.7.0",
"tslib": "^2.6.2",
"typescript": "^5.2.2"
},
"files": [
"dist"
],
"types": "dist/index/.d.ts"
}