-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get version constant from package.json #5107
Conversation
Including the package.json file into the built client-side library feels a bit wrong to me, even though as an opensource project we won't have any security implications from doing so. A few other options to consider would be:
|
Is it possible to import the version number using ES6 import statement and let the build step tree shaking the unneeded info from package.json? Not sure if something like that will work at all though. If not then something like option 1 proposed by @akshay-99 would probably be fine as well. |
thanks for the comments! |
oh. test failed because of the undefined const. maybe replacing this with a valid string e.g. |
I think you can ask the linter to ignore that line as well. |
this is awesome @micuat! one tiny request, could we use something like |
@outofambit thanks <3 yes I totally agree, I also thought that the text should be unique + recognizable if something broke during the grunt process |
awesome, thanks everyone!! |
Resolves #2525 continuing from #5096
Changes:
add version constant taking from
package.json
reflecting @lmccart 's comment #5096 (review)However the downside is that the whole
package.json
seems to be exposed to the minifined file. This is not a problem as the project is open-source, but I wonder if it causes other issues.snippets from compiled bundle:
PR Checklist
npm run lint
passes