package.json is included in the build files
See original GitHub issueHi
I just noticed that your
lib\version.js file is looking for a version from package.json
module.exports = require('../package.json').version;
What this is doing internally, it exports all packege.json file as js module and adds it to the minified/uglified build.
So in my build, I got your whole package.json file with all dependencies and settings for no reason.
I also noticed that error with my build. I get around this by using node.env to pass it in like this:
version: process.env.VERSION
I do not know will this work for you but you will find a solution that fits your need.
Please modify this so your packege.json will not be added to any build that someone will make while using your library.
Regards
Issue Analytics
- State:
- Created 5 years ago
- Comments:17
Top Results From Across the Web
package.json - npm Docs
json which is a map of command name to local file name. When this package is installed globally, that file will be either...
Read more >Javascript: is package.json dependency included in build, if ...
The package.json and the dev-dependencies are primarily about your module being installed by others, when you do not distribute a bundled ...
Read more >The Basics of Package.json - NodeSource
The package.json file is core to the Node.js ecosystem and is a fundamental part of understanding and working with Node.js , npm ......
Read more >A deep dive on the package.json file | Geek.I.Am
The package.json is one of the core components of the Node runtime environment, and it typically included in the project root directory of...
Read more >Two package.json Structure - electron-builder
The package.json resides in the root of your project. Here you declare the dependencies for your development environment and build scripts ( devDependencies...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@eloc3147 not sure if you’re still having this issue.
I ran into this also, and had to add a clean script in my package.json scripts section
"clean": "rm -rf node_modules/websocket/.git",
"heroku-postbuild": "npm run clean && npm install --only=dev --no-shrinkwrap",
Not sure what side effects it will have (none yet). My build is completing successfully now.
This is not a cosmetic change.
I see you’re not getting the problem with it. Some people really care about code size and security issues.
Cosmetic is the solution. But I do not know how to apply it to your code, cause I do not know it as you do.
So I do not understand why did you close this issue ?? It’s not done and it’s not cosmetic.