![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
browserify-async-define
Advanced tools
Note: This is working and battle tested, but I suggest to use either webpack or rollup instead (I explain the reason at the bottom)
This browserify plugin can be used to wrap some dependencies using async-define and thus, factor out those in common bundles.
Options:
With the main.js:
var $ = require('jquery');
var $node = $('<div>Hello</div>').appendTo(document.body);
You can build bundle and main like this:
browserify main.js -o dist/main.js -p [browserify-async-define -d jquery:jquery2.2:dist/common.js]
or using the api:
var browserifyAsyncDefine = require('browserify-async-define');
var b = browserify('main.js')
.plugin(browserifyAsyncDefine, {
dependsOn: ['jquery:jquery2.2:dist/common.js]
});
and then load them like this:
<script async src="dist/common.js"></script>
<script async src="dist/main.js"></script>
You can factor out multiple dependencies and use the "label" to express different versions:
browserify main.js -o dist/main.js -p [browserify-async-define -d jquery:jquery20:dist/jquery.js -d react:react014:dist/react.js -d react-dom:reactDom014:dist/react.js]
and then load them like this:
<script async src="dist/jquery.js"></script>
<script async src="dist/react.js"></script>
<script async src="dist/main.js"></script>
async-define will isolate the namespace and allow to use different versions of a package.
To use this plugin you should also install this package:
"async-define": "latest",
async-define has the same interface used by AMD modules. So it was very easy to create a rollup or webpack plugin because they are already able to produce an AMD output of the bundle. This plugin instead is pretty complicated and heavy to maintain. I consider this to be deprecated and only apply the least possible maintenance.
FAQs
Browserify plugin for async-define
The npm package browserify-async-define receives a total of 7 weekly downloads. As such, browserify-async-define popularity was classified as not popular.
We found that browserify-async-define 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.