Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@roots/bud-minify

Package Overview
Dependencies
Maintainers
0
Versions
533
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@roots/bud-minify

CSS and JS minification for bud.js

  • 2024.11.15-9
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.4K
decreased by-3.06%
Maintainers
0
Weekly downloads
 
Created
Source

bud.js

MIT License npm Follow Roots

@roots/bud-minify

CSS and JS minification for bud.js


Installation

Install @roots/bud-minify to your project.

Yarn:

yarn add @roots/bud-minify --dev

npm:

npm install @roots/bud-minify --save-dev

Options

bud.minify.js

OptiontypeDefault
minifyTerserPlugin.MinimizerImplementationterser
includeTerserPlugin.BasePluginOptions['include']undefined
excludeTerserPlugin.BasePluginOptions['exclude']undefined
extractCommentsTerserPlugin.BasePluginOptions['extractComments']false
parallelTerserPlugin.BasePluginOptions['parallel']true
terserOptionsTerserPlugin.TerserOptions[object]
  • When @roots/bud-swc is installed the swc minifier function will be used.
  • When @roots/bud-esbuild is installed the esbuild minifier function will be used.

bud.minify.css

OptiontypeDefault
minifyCSSMinimizerPlugin.MinimizerImplementationlightningcss
testCSSMinimizerPlugin.BasePluginOptions['test']undefined
includeCSSMinimizerPlugin.BasePluginOptions['include']undefined
excludeCSSMinimizerPlugin.BasePluginOptions['exclude']undefined
parallelCSSMinimizerPlugin.BasePluginOptions['parallel']true
minimizerOptionsCSSMinimizerPlugin.BasePluginOptions['minimizerOptions'][object]

bud.minify.js

bud.minify.js.getInclude

Get the value of include

bud.minify.js.getInclude();

Set the value of include

bud.minify.js.setInclude(/.*/);

bud.minify.js.exclude

Get the value of exclude

bud.minify.js.getExclude();

Set the value of exclude

bud.minify.js.setExclude(/.*/);

bud.minify.js.minify

Get the value of minify.

bud.minify.js.getMinify();

Set the value of minify. Since the value is a function you must wrap it in a callback.

const dubiousMinifier = async (input: unknown) => ({
  code: Object.values(input).join(`\n`).replace(/\/\//g, `// 💸`),
});

bud.minify.js.setMinify(() => dubiousMinifier);

bud.minify.js.parallel

Get the value of parallel.

bud.minify.js.getParallel();

Set the value of parallel.

bud.minify.js.setParallel(true);

bud.minify.js.extractComments

Get the value of extractComments.

bud.minify.js.getExtractComments();

Set the value of extractComments.

bud.minify.js.setExtractComments(true);

bud.minify.js.terserOptions

Get the value of terserOptions.

bud.minify.js.getTerserOptions();

Set the value of terserOptions.

bud.minify.js.setTerserOptions((options) => ({
  ...options,
  mangle: false,
}));

bud.minify.js.dropComments

Remove comments from output:

export default async (bud) => {
  bud.minify.js.dropComments();
};

bud.minify.js.dropConsole

Remove console.* statements from output.

export default async (bud) => {
  bud.minify.js.dropConsole();
};

Contributing

Contributions are welcome from everyone.

We have contribution guidelines to help you get started.

License

@roots/bud-minify is licensed under MIT.

Community

Keep track of development and community news.

Sponsors

bud.js is an open source project and completely free to use.

However, the amount of effort needed to maintain and develop new features and projects within the Roots ecosystem is not sustainable without proper financial backing. If you have the capability, please consider sponsoring Roots.

Carrot WordPress.com Worksite Safety Itineris

Keywords

FAQs

Package last updated on 15 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc