0.1.0-alpha.1 • Published 5 months ago
rollup-plugin-package-json-sanitize v0.1.0-alpha.1
rollup-plugin-package-json-sanitize
This is a rollup plugin to clean several sections from a package.json during build process before publishing it.
Content
Table of Contents
Usage
Parameters
Name | Required | Type | Default | Description |
---|---|---|---|---|
sourceFilePath | false | string | ./package.json | The package.json which should be sanitized |
targetDirectory | false | string | ./dist | The destination directory name |
targetFileName | false | string | package.json | The name of your destination file |
config | true | Object | - | The plugin configuration for sanitizing the package.json |
Supported Configuration
remove
- The
remove
operation can be used to remove properties and according values from apackage.json
file. The properties to remove are declared as astring[]
Types:string[]
Example configuration
The plugin can simply added to your existing rollup.config.js
configuration file:
...
import cleanPackageJson from "rollup-plugin-package-json-sanitize";
...
export default {
input: "src/index.ts",
...
},
plugins: [
...
cleanPackageJson({
sourceFilePath: "./package.json",
targetDirectory: "./dist",
targetFileName: "package.json",
config: [
{
operation: "remove",
propertyNames: ["dependencies", "devDependencies", "scripts"],
},
],
}),
...
],
};
Development
Build
Install depencencies
npm install
Build the package as prod
npm run build # npm run build:dev # For debugging purpose
0.1.0-alpha.1
5 months ago
0.1.0-alpha.0
5 months ago