![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.
require-package
Advanced tools
require-package is a simple library to build a config object that can be used with the requirejs AMD loader. It will generate the appropriate path, shim and module information for your specified environment, enabling the packaging information to be specified in only one place.
For example, in your package json:
"vendor": {
"backbone": {
"source": "node_modules/backbone.js",
"shim": {"exports": "Backbone", "deps": ["underscore","jquery"]}
},
"underscore": {
"source": "node_modules/underscore/underscore-min.js",
"shim": {"exports": "_"}
},
"jquery": {
"source": "vendor/js/jquery-1.8.1.min.js"
}
}
Then, you can build use require-package in various places to vendor and build a config file for requirejs.
// in jakefile, to vendor the javascript files into your server
var requirePackage = require('require-package');
var toVendor = requirePackage.vendor('www/js/vendor');
for (var source in toVendor) {
file(toVendor[source], [source], function() {
jake.cpR(source,toVendor[source]);
});
}
Or, in your templates, to init requirejs:
require.config(<% require('require-package').config({baseUrl: '/js'}) %>);
require-config
exports several functions to help in your build setup.
vendor
will return on object with the path to the source file to be
vendored as the key, and the destination path as the value:
{ 'node_modules/backbone/backbone.js': 'www/js/vendor/backbone.js' }
Extends the baseConfig object with the shim and path config values.
FAQs
Generate requirejs configuration from package.json values
The npm package require-package receives a total of 1 weekly downloads. As such, require-package popularity was classified as not popular.
We found that require-package 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.