webpack-dynamic-require
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -163,2 +163,20 @@ "use strict"; | ||
function loadComponentCss(baseUrl, styleId, needComboCssChunk) { | ||
var componentCss = 'component.css'; | ||
var comboCssChunks = needComboCssChunk.map(function (chunkName) { | ||
return "deps/".concat(chunkName, ".css"); | ||
}); | ||
comboCssChunks.unshift(componentCss); | ||
var comboCssUrl = "".concat(baseUrl, "/??").concat(comboCssChunks.join()); | ||
var ss = (0, _fgLoadcss.loadCSS)(comboCssUrl); // @ts-ignore | ||
ss && ss.setAttribute('id', styleId); | ||
return new Promise(function (resolve, reject) { | ||
onloadCSS(ss, function () { | ||
resolve(); | ||
}); | ||
setTimeout(reject, 5000); | ||
}); | ||
} | ||
function DynamicRequire(name, baseUrl, hashed) { | ||
@@ -171,2 +189,13 @@ if (!name || !baseUrl) { | ||
var jsonpUrl = "".concat(baseUrl, "/jsonpmodules.js"); | ||
var scriptId = "".concat(name, "_js"); | ||
var styleId = "".concat(name, "_css"); | ||
var uninstallFn = "".concat(name, "_uninstall"); // @ts-ignore | ||
window[uninstallFn] = function () { | ||
var jse = document.getElementById(scriptId); | ||
var csse = document.getElementById(styleId); | ||
jse && jse.remove(); | ||
csse && csse.remove(); | ||
}; | ||
return jsonp(jsonpUrl, { | ||
@@ -178,2 +207,5 @@ cbVal: jsonpCallback | ||
var entryModuleName = "".concat(name, "/").concat(entry); | ||
var componentChunks = 'vendor.js,component.js'; | ||
var needComboCssChunk = []; | ||
var needComboChunk = []; | ||
@@ -186,12 +218,2 @@ if (hashed) { | ||
if (g.webpackData.c[entryModuleName]) { | ||
// if webpack enable hmr above return { children, exports, hot ...} | ||
var module = g.webpackData(entryModuleName); | ||
return Promise.resolve(module.a || module); | ||
} | ||
var componentChunks = 'vendor.js,component.js'; | ||
var componentCss = 'component.css'; | ||
var needComboChunk = []; | ||
var needComboCssChunk = []; | ||
modules.forEach(function (_ref) { | ||
@@ -212,18 +234,20 @@ var _ref2 = _slicedToArray(_ref, 3), | ||
} | ||
}); // 先加载css | ||
}); // 已经加载过了的逻辑 | ||
var ssPromise; | ||
var comboCssChunks = needComboCssChunk.map(function (chunkName) { | ||
return "deps/".concat(chunkName, ".css"); | ||
}); | ||
comboCssChunks.unshift(componentCss); | ||
var comboCssUrl = "".concat(baseUrl, "/??").concat(comboCssChunks.join()); | ||
var ss = (0, _fgLoadcss.loadCSS)(comboCssUrl); | ||
ssPromise = new Promise(function (resolve, reject) { | ||
onloadCSS(ss, function () { | ||
resolve(); | ||
}); | ||
setTimeout(reject, 5000); | ||
}); // 并行加载js | ||
if (g.webpackData.c[entryModuleName]) { | ||
// if webpack enable hmr above return { children, exports, hot ...} | ||
var module = g.webpackData(entryModuleName); | ||
var csse = document.getElementById(styleId); // 样式已经卸载,重新加载出来 | ||
if (!csse) { | ||
loadComponentCss(baseUrl, styleId, needComboCssChunk); | ||
} | ||
return Promise.resolve(module.a || module); | ||
} // 新加载逻辑 | ||
// 加载css | ||
var ssPromise = loadComponentCss(baseUrl, styleId, needComboCssChunk); // 并行加载js | ||
var jsPromise; | ||
@@ -263,2 +287,2 @@ var comboChunks = needComboChunk.map(function (chunkName) { | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9EeW5hbWljLnRzIl0sIm5hbWVzIjpbImciLCJ3aW5kb3ciLCJnbG9iYWwiLCJvbmxvYWRDU1MiLCJzcyIsImNhbGxiYWNrIiwiY2FsbGVkIiwibmV3Y2IiLCJjYWxsIiwiYWRkRXZlbnRMaXN0ZW5lciIsImF0dGFjaEV2ZW50IiwibmF2aWdhdG9yIiwib25sb2FkY3NzZGVmaW5lZCIsImpzb25wIiwidXJsIiwib3B0IiwiZm4iLCJ0aW1lb3V0IiwiY2JLZXkiLCJjYlZhbCIsInRpbWVyIiwiRGF0ZSIsIm5vdyIsInMiLCJzbGljZSIsImluZGV4T2YiLCJzY3JpcHQiLCJkb2N1bW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ICAgICAgICAgIGNvbnNvbGUubG9nKCdsb2FkIGNvbWJvIGpzIGRvbmUnLCBuYW1lKTtcbiAgICAgICAgICBjb25zdCBtb2R1bGUgPSBnLndlYnBhY2tEYXRhKGVudHJ5TW9kdWxlTmFtZSk7XG4gICAgICAgICAgcmVzb2x2ZShtb2R1bGUuYSB8fCBtb2R1bGUpO1xuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgcmVqZWN0KGUpO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9KTtcbiAgICByZXR1cm4gUHJvbWlzZS5hbGwoW3NzUHJvbWlzZSwganNQcm9taXNlXSkudGhlbigoW3NzLCBtb2R1bGVdKSA9PiB7XG4gICAgICByZXR1cm4gbW9kdWxlO1xuICAgIH0pLmNhdGNoKGUgPT4ge1xuICAgICAgY29uc29sZS53YXJuKCdib290bG9hZCBtb2R1bGUgZXJyb3InLCBlKTtcbiAgICB9KVxuICB9KS5jYXRjaChmdW5jdGlvbiAoZXJyb3I6IGFueSkge1xuICAgIGNvbnNvbGUud2FybignbG9hZCByZW1vdGUgZXJyb3InKTtcbiAgICB0aHJvdyBlcnJvclxuICB9KVxufSJdfQ== | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9EeW5hbWljLnRzIl0sIm5hbWVzIjpbImciLCJ3aW5kb3ciLCJnbG9iYWwiLCJvbmxvYWRDU1MiLCJzcyIsImNhbGxiYWNrIiwiY2FsbGVkIiwibmV3Y2IiLCJjYWxsIiwiYWRkRXZlbnRMaXN0ZW5lciIsImF0dGFjaEV2ZW50IiwibmF2aWdhdG9yIiwib25sb2FkY3NzZGVmaW5lZCIsImpzb25wIiwidXJsIiwib3B0IiwiZm4iLCJ0aW1lb3V0IiwiY2JLZXkiLCJjYlZhbCIsInRpbWVyIiwiRGF0ZSIsIm5vdyIsInMiLCJzbGljZSIsImluZGV4T2YiLCJzY3JpcHQiLC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1xuICAgICAgU2NyaXB0anMoY29tYm9VcmwsICgpID0+IHtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICBjb25zb2xlLmxvZygnbG9hZCBjb21ibyBqcyBkb25lJywgbmFtZSk7XG4gICAgICAgICAgY29uc3QgbW9kdWxlID0gZy53ZWJwYWNrRGF0YShlbnRyeU1vZHVsZU5hbWUpO1xuICAgICAgICAgIHJlc29sdmUobW9kdWxlLmEgfHwgbW9kdWxlKTtcbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgIHJlamVjdChlKTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgfSk7XG4gICAgcmV0dXJuIFByb21pc2UuYWxsKFtzc1Byb21pc2UsIGpzUHJvbWlzZV0pLnRoZW4oKFtzcywgbW9kdWxlXSkgPT4ge1xuICAgICAgcmV0dXJuIG1vZHVsZTtcbiAgICB9KS5jYXRjaChlID0+IHtcbiAgICAgIGNvbnNvbGUud2FybignYm9vdGxvYWQgbW9kdWxlIGVycm9yJywgZSk7XG4gICAgfSlcbiAgfSkuY2F0Y2goZnVuY3Rpb24gKGVycm9yOiBhbnkpIHtcbiAgICBjb25zb2xlLndhcm4oJ2xvYWQgcmVtb3RlIGVycm9yJyk7XG4gICAgdGhyb3cgZXJyb3JcbiAgfSlcbn0iXX0= |
{ | ||
"name": "webpack-dynamic-require", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "you can require cdn bundle dynamic", | ||
@@ -5,0 +5,0 @@ "main": "lib/Dynamic.js", |
@@ -132,2 +132,21 @@ import Scriptjs from 'scriptjs'; | ||
function loadComponentCss(baseUrl: string, styleId: string, needComboCssChunk: string[]) { | ||
const componentCss = 'component.css'; | ||
const comboCssChunks = needComboCssChunk.map(chunkName => `deps/${chunkName}.css`); | ||
comboCssChunks.unshift(componentCss); | ||
const comboCssUrl = `${baseUrl}/??${comboCssChunks.join()}`; | ||
const ss = loadCSS(comboCssUrl); | ||
// @ts-ignore | ||
ss && ss.setAttribute('id', styleId); | ||
return new Promise((resolve, reject) => { | ||
onloadCSS(ss, () => { | ||
resolve(); | ||
}); | ||
setTimeout(reject, 5000); | ||
}); | ||
} | ||
export function DynamicRequire(name: string, baseUrl: string, hashed: boolean) { | ||
@@ -139,2 +158,12 @@ if (!name || !baseUrl) { | ||
const jsonpUrl = `${baseUrl}/jsonpmodules.js`; | ||
const scriptId = `${name}_js`; | ||
const styleId = `${name}_css`; | ||
const uninstallFn = `${name}_uninstall`; | ||
// @ts-ignore | ||
window[uninstallFn] = () => { | ||
const jse = document.getElementById(scriptId); | ||
const csse = document.getElementById(styleId); | ||
jse && jse.remove(); | ||
csse && csse.remove(); | ||
} | ||
return jsonp(jsonpUrl, { | ||
@@ -146,2 +175,6 @@ cbVal: jsonpCallback | ||
let entryModuleName = `${name}/${entry}`; | ||
const componentChunks = 'vendor.js,component.js'; | ||
const needComboCssChunk: string[] = []; | ||
const needComboChunk: string[] = []; | ||
if (hashed) { | ||
@@ -152,12 +185,3 @@ const hashState = new MurmurHash3(); | ||
} | ||
if (g.webpackData.c[entryModuleName]) { | ||
// if webpack enable hmr above return { children, exports, hot ...} | ||
const module = g.webpackData(entryModuleName); | ||
return Promise.resolve(module.a || module); | ||
} | ||
const componentChunks = 'vendor.js,component.js'; | ||
const componentCss = 'component.css'; | ||
const needComboChunk: string[] = []; | ||
const needComboCssChunk: string[] = []; | ||
modules.forEach(([moduleName, chunkName, isCss]) => { | ||
@@ -173,15 +197,18 @@ const module = g.webpackData.c[moduleName]; | ||
}); | ||
// 先加载css | ||
let ssPromise; | ||
const comboCssChunks = needComboCssChunk.map(chunkName => `deps/${chunkName}.css`); | ||
comboCssChunks.unshift(componentCss); | ||
const comboCssUrl = `${baseUrl}/??${comboCssChunks.join()}`; | ||
const ss = loadCSS(comboCssUrl); | ||
ssPromise = new Promise((resolve, reject) => { | ||
onloadCSS(ss, () => { | ||
resolve(); | ||
}); | ||
setTimeout(reject, 5000); | ||
}); | ||
// 已经加载过了的逻辑 | ||
if (g.webpackData.c[entryModuleName]) { | ||
// if webpack enable hmr above return { children, exports, hot ...} | ||
const module = g.webpackData(entryModuleName); | ||
const csse = document.getElementById(styleId); | ||
// 样式已经卸载,重新加载出来 | ||
if (!csse) { | ||
loadComponentCss(baseUrl, styleId, needComboCssChunk); | ||
} | ||
return Promise.resolve(module.a || module); | ||
} | ||
// 新加载逻辑 | ||
// 加载css | ||
const ssPromise = loadComponentCss(baseUrl, styleId, needComboCssChunk); | ||
// 并行加载js | ||
@@ -188,0 +215,0 @@ let jsPromise; |
77271
835