Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
bundler.macro
Advanced tools
Bundle local JavaScript and TypeScript files with parcel.js.
bundler.macro
is designed to be used with babel-plugin-macros to bundle or transpile files during your build step.
First, install the plugin and it's peer dependency (babel-plugin-macros
). Since the macro is compiled away during the build, it should be installed as a devDependency
to prevent bloating the dependency tree of the consumers of your package.
# yarn
yarn add bundler.macro babel-plugin-macros
# pnpm
pnpm add bundler.macro babel-plugin-macros
# npm
npm install bundler.macro babel-plugin-macros
Once installed make sure to add the 'babel-plugin-macros' to your babel.config.js
(or .babelrc
) file.
.babelrc
{
"plugins": [
+ "macros",
"other",
"plugins"
]
}
babel.config.js
module.exports = {
// rest of config...,
plugins: [
+ 'macros',
...otherPlugins,
]
}
Bundle files using esbuild.
import { esbuildBundler } from 'bundler.macro';
// The file is bundled with `esbuild` and the output is provided as a string.
const bundledOutput: string = esbuildBundler('./main.ts');
Bundle files using rollup.
import { rollupBundler } from 'bundler.macro';
// The file is bundled with `rollup` and the output is provided as a string.
const bundledOutput: string = rollupBundler('./main.ts');
Transpile a file using babel
This should be used when you want to get the string output from a file, in a format that can be
import { transpileFile } from 'bundler.macro';
// The file is transpiled as a single file with babel.
const output: string = transpileFile('./simple.js');
FAQs
Bundle local JavaScript and TypeScript files with parcel.js.
The npm package bundler.macro receives a total of 46 weekly downloads. As such, bundler.macro popularity was classified as not popular.
We found that bundler.macro demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.