1. package-json-filterify
Browserify transform to filter package.json fields
package-json-filterify
Package: package-json-filterify
Created by: kribblo
Last modified: Thu, 23 Jun 2022 06:33:13 GMT
Version: 1.0.4
License: ISC
Downloads: 38
Repository: https://github.com/kribblo/package-json-filterify

Install

npm install package-json-filterify
yarn add package-json-filterify

package-json-filterify

Browserify transform to filter package.json when it is required, so as to not include all of it in the final bundle.

By default, keeps "name" and "version" fields, but this can be configured.

npm install --save-dev package-json-filterify
 var packageJson = require('./package.json');
console.log(packageJson.name, packageJson.version);

Usage

Command line

browserify -t package-json-filterify input.js > output.js

browserify field

 {
  "browserify": {
    "transform": [
      "package-json-filterify"
    ]
  }
}

Configuration

Configure what fields to keep:

package.json

 {
    "package-json-filterify": {"keep": ["name", "version", "main"]}
}

browserify field

 {
  "browserify": {
    "transform": [
      ["package-json-filterify", {"keep": ["name", "version", "main"]}]
    ]
  }
}

See also

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