Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
bify-module-groups
Advanced tools
Readme
Browserify tools for splitting bundles into groups of modules
When adding the plugin, the browserify stream has an output of a single ModuleGroup
object.
The output stream can then be piped into other provided tools to customize the groups to your desire
This will generate three bundles. One bundle for packages unique to each of the entrypoints, and one common bundle for packages that are used by both.
const pump = require('pump')
const browserify = require('browserify')
const browserPack = require('browser-pack')
const { groupBySize, createForEachStream } = require('bify-module-groups')
const vfs = require('vinyl-fs')
const bundler = browserify(['entry1.js', 'entry2.js'])
.plugin('bify-module-groups/plugin')
pump(
// perform bundle
bundler.bundle(),
// split in to module groups
groupBySize({ sizeLimit: 200 }),
// handle each module group
createForEachStream({
onEach: (moduleGroup) => {
pump(
moduleGroup.stream,
browserPack({ raw: true }),
vfs.dest(`./bundles/${moduleGroup.label}.js`),
)
}
}),
)
const path = require('path')
const pump = require('pump')
const browserify = require('browserify')
const browserPack = require('browser-pack')
const { groupByFactor, createForEachStream } = require('bify-module-groups')
const vfs = require('vinyl-fs')
const bundler = browserify(['./entry1.js', './entry2.js'])
.plugin('bify-module-groups/plugin')
pump(
// perform bundle
bundler.bundle(),
// split in to module groups
groupByFactor({
entryFileToLabel: (entry) => path.parse(entry).name
}),
// handle each module group
createForEachStream({
onEach: (moduleGroup) => {
pump(
moduleGroup.stream,
browserPack({ raw: true, hasExports: true }),
vfs.dest(`./bundles/${moduleGroup.label}.js`),
)
}
}),
)
You can then import the common bundle as well as your entry-specific bundle.
<title>page one</title>
<script src="./bundles/common.js">
<script src="./bundles/entry1.js">
<title>page two</title>
<script src="./bundles/common.js">
<script src="./bundles/entry2.js">
FAQs
Browserify tools for splitting bundles into groups of modules
The npm package bify-module-groups receives a total of 470 weekly downloads. As such, bify-module-groups popularity was classified as not popular.
We found that bify-module-groups demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.