New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

requirejs-config

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

requirejs-config

The small utilities to load require.js config path and shim configuration.

latest
Source
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

requirejs-config

The small utilities to load require.js config path and shim configuration.

How to use

All the sample written in es6 then precompiled to umd modules.

html:

<script data-main="main" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"></script>

config.jsx

export default {
  paths : {
    "react"            : "//unpkg.com/react@16.7.0/umd/react.development",
    "react-dom"        : "//unpkg.com/react-dom@16.7.0/umd/react-dom.development",
  },
  shim: {

  },
}

config2.jsx

export default {
  paths : {
    "jquery"           : "//unpkg.com/jquery@2.2.4/dist/jquery.min",
  },
  shim: {
    'jquery' : {
      exports: '$'
    },
  },
}

main.jsx

import loadConfig from "//unpkg.com/requirejs-config@1.0.0/index.min";
loadConfig(['./config', './config2'], ()=>{
  require(['react', 'jquery'], (React, JQuery) =>{
    console.log(React);
    console.log(JQuery);
  });
});

Keywords

requirejs

FAQs

Package last updated on 22 Jan 2019

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