Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
broccoli-multi-builder
Advanced tools
The idea:
import "my-other-codebase"
) in your src es6 code, have it work seamlessly with building for any of the output formatsTo build your es6 code using broccoli-multi-builder
:
npm install --save-dev broccoli-multi-builder
npm install --global broccoli-cli
npm install --save-dev broccoli-merge-trees
Add a Brocfile.js
in the root of your project with the following code:
var multiBuilder = require('broccoli-multi-builder');
var mergeTrees = require('broccoli-merge-trees');
var amdOptions = {
src: 'path/to/es6/src/directory',
isGlobal: false,
packageName: 'my-package', // influences the name of the built file and directories,
// and the source root for the amd modules
vendoredModules: [] // the npm package names of any other modules that your es6 code
// consumes. Those packages must have a file/directory structure
// as described below
};
var cjsOptions = {
src: 'path/to/es6/src/directory',
// isGlobal is not relevant for a cjs build
packageName: 'my-package',
vendoredModules: [] // same as the vendored modules for the amdOptions
}
module.exports = mergeTrees([
multiBuilder.buildAMD(amdOptions),
multiBuilder.buildCJS(cjsOptions)
]);
Then do a broccoli build dist
to put your cjs and amd output into dist/
.
Note that broccoli will complain about writing to a directory that already exists
so you may need to rm -rf dist
first.
Read more about broccoli.js here.
If you are writing code:
src/
written is es6 style (import/export)If you are writing code for another package that uses broccoli-multi-builder to consume:
src/
to npm and:./dist/<packageName>
with dist/<packageName>/index.js
)index.js
above should export a default
(this is what a consumer will get if they import X from "your-package"
-- this happens automatically if you build with broccoli-multi-builder)"main"
entry should point to dist/<packageName>/index.js
If you are consuming another library built with broccoli-multi-builder:
npm install other-package
src/
es6 code, it should be fine to import default (import X from "other-package"
) and named exports (import { namedThing} from "other-package"
)import X from "other-package/thing"
)FAQs
write and consume es6 source code, build to amd, globals or commonjs
The npm package broccoli-multi-builder receives a total of 10 weekly downloads. As such, broccoli-multi-builder popularity was classified as not popular.
We found that broccoli-multi-builder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.