@webmangler/core
TypeScript icon, indicating that this package has built-in type declarations

0.1.28 • Public • Published

WebMangler Core

NPM Package

The WebMangler Core is the central package of the WebMangler ecosystem. It can be used by itself programmatically or through other packages and plugins.

Usage

Install the webmangler core, e.g.:

npm install webmangler --save-dev

And use it programmatically, e.g.:

import webmangler from "@webmangler/core";

import { BuiltInLanguagesSupport } from "webmangler/languages";
import { RecommendedManglers } from "webmangler/manglers";

// Read in the files you want to mangle ...
const originalFiles = [
  { type: "css", content: "..." },
  { type: "html", content: "..." },
  { type: "js", content: "..." },
];

// and run WebMangler.
const { files } = webmangler(originalFiles, {
  plugins: [new RecommendedManglers()],
  languages: [new BuiltInLanguagesSupport()],
});

console.log(files[0]);
// Outputs:  { type: "css", content: "..." }

Which will mangle CSS classes, CSS variables, and HTML data attributes in CSS, HTML, and JavaScript.

Other ways to use WebMangler

Readme

Keywords

none

Package Sidebar

Install

npm i @webmangler/core

Weekly Downloads

1

Version

0.1.28

License

MIT

Unpacked Size

87.9 kB

Total Files

54

Last publish

Collaborators

  • ericcornelissen