1.0.14-doc.2 • Published 2 years ago

systemjs-intercept v1.0.14-doc.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago
require("systemjs-intercept")(function (dep) {
  // 能够拦截system的请求, 包含依赖
  // 比如请求npm cdn的react-dom模块, 其依赖"react"
  if (dep === "react") {
    return window.System.import("https://cdn.jsdelivr.net/npm/react@18.2.0/umd/react.development.js")
    // 可以返回自定义值
    // return {
    //   test: "react"
    // }
  }
}, window.System)
console.log(111, window.System.import("https://cdn.jsdelivr.net/npm/react-dom@18.2.0/umd/react-dom.development.js"))
const newSystem = new window.System.constructor()
require("systemjs-intercept")(function (dep) {
  // 能够拦截system的请求, 包含依赖
  // 比如请求npm cdn的react-dom模块, 其依赖"react"
  if (dep === "react") {
    return newSystem.import("https://cdn.jsdelivr.net/npm/react@18.2.0/umd/react.development.js")
    // 可以返回自定义值
    // return {
    //   test: "react"
    // }
  }
}, newSystem)
console.log(111, newSystem.import("https://cdn.jsdelivr.net/npm/react-dom@18.2.0/umd/react-dom.development.js"))
1.0.14-doc.2

2 years ago

1.0.14-doc.1

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago