Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

auto-preload-rjscommon-deps-loader

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auto-preload-rjscommon-deps-loader

Preload commonjs deps in AMD require.js dependencies

  • 1.0.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

auto-preload-rjscommon-deps-loader

Simple loader function that causes a source file using require.js' commonjs syntax to have it's deps hoisted to the outer scope, so that it behaves like it does in require.js.

To use, simply add this module to the loaders for the specific files you want to wrap.

...
module: {
  loaders: [
    ...
    { test: /\/src\/.+\.js$/, loader: 'auto-preload-rjscommon-deps' }
    ...
  ]
}
...

NOTE: files containing define(function(require somewhere will be modified, and at this time all require calls are hoisted and duplicated.

todo

  • always load every dep before calling factory passed to define()
  • use parser plugins rather than regexp
  • only preload requires that are not a the top level of the module
  • only preload modules actually within the define factory
  • convert to use define([deps], factory) syntax

Keywords

FAQs

Package last updated on 30 Jul 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc