1. package-json-versionify
Browserify transform to strip package.json of everything but the version
package-json-versionify
Package: package-json-versionify
Created by: nolanlawson
Last modified: Thu, 23 Jun 2022 06:35:07 GMT
Version: 1.0.4
License: Apache-2.0
Downloads: 119,289
Repository: https://github.com/nolanlawson/package-json-versionify

Install

npm install package-json-versionify
yarn add package-json-versionify

package-json-versionify Build Status

Browserify transform to strip everything from package.json except for
the "version" field.

Installation

npm install --save package-json-versionify

Description

Say you want to ship a library, and do something like:

 MyLibrary.version = require('./package.json').version;

Unfortunately, if you do this, then your entire package.json will be included
in the output Browserify bundle, which will increase your bundle size. Bummer!

However, if you use this transform, then it will remove everything from package.json except for the "version" field. So when you require('./package.json'), you get something much more compact, e.g.:

 {"version":"1.0.0"}

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin