draft: refactor project so it sits on top of a standalone app
This commit is contained in:
+3
@@ -0,0 +1,3 @@
|
||||
module.exports = function() {
|
||||
throw new Error("define cannot be used indirect");
|
||||
};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
/* globals __webpack_amd_options__ */
|
||||
module.exports = __webpack_amd_options__;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
var g;
|
||||
|
||||
// This works in non-strict mode
|
||||
g = (function() {
|
||||
return this;
|
||||
})();
|
||||
|
||||
try {
|
||||
// This works if eval is allowed (see CSP)
|
||||
g = g || new Function("return this")();
|
||||
} catch (e) {
|
||||
// This works if the window reference is available
|
||||
if (typeof window === "object") g = window;
|
||||
}
|
||||
|
||||
// g can still be undefined, but nothing to do about it...
|
||||
// We return undefined, instead of nothing here, so it's
|
||||
// easier to handle this case. if(!global) { ...}
|
||||
|
||||
module.exports = g;
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
module.exports = function(originalModule) {
|
||||
if (!originalModule.webpackPolyfill) {
|
||||
var module = Object.create(originalModule);
|
||||
// module.parent = undefined by default
|
||||
if (!module.children) module.children = [];
|
||||
Object.defineProperty(module, "loaded", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return module.l;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(module, "id", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return module.i;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(module, "exports", {
|
||||
enumerable: true
|
||||
});
|
||||
module.webpackPolyfill = 1;
|
||||
}
|
||||
return module;
|
||||
};
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
module.exports = function(module) {
|
||||
if (!module.webpackPolyfill) {
|
||||
module.deprecate = function() {};
|
||||
module.paths = [];
|
||||
// module.parent = undefined by default
|
||||
if (!module.children) module.children = [];
|
||||
Object.defineProperty(module, "loaded", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return module.l;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(module, "id", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return module.i;
|
||||
}
|
||||
});
|
||||
module.webpackPolyfill = 1;
|
||||
}
|
||||
return module;
|
||||
};
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// Provide a "System" global.
|
||||
module.exports = {
|
||||
// Make sure import is only used as "System.import"
|
||||
import: function() {
|
||||
throw new Error("System.import cannot be used indirectly");
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user