gatsby-module-loader
Advanced tools
Comparing version 1.1.0-alpha.1460dad9 to 1.1.0-alpha.1a8f691e
24
index.js
@@ -1,9 +0,3 @@ | ||
"use strict"; | ||
var _JSON$stringify = require("@babel/runtime/core-js/json/stringify"); | ||
var _stringify = require("babel-runtime/core-js/json/stringify"); | ||
var _stringify2 = _interopRequireDefault(_stringify); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/* | ||
@@ -16,9 +10,8 @@ Based on Tobias Koppers @sokra bundle-loader | ||
var loaderUtils = require("loader-utils"); | ||
var path = require("path"); | ||
module.exports = function () {}; | ||
module.exports.pitch = function (remainingRequest) { | ||
this.cacheable && this.cacheable(); | ||
var query = loaderUtils.parseQuery(this.query); | ||
var query = loaderUtils.getOptions(this) || {}; | ||
var chunkName = ""; | ||
@@ -31,14 +24,7 @@ | ||
}); | ||
chunkName = ", " + (0, _stringify2.default)(chunkName); | ||
} | ||
var request = loaderUtils.stringifyRequest(this, "!!" + remainingRequest); | ||
var callback = "function() { return require(" + request + ") }"; | ||
var executor = "return require.ensure([], function(_, error) {\n if (error) {\n console.log('bundle loading error', error)\n cb(true)\n } else {\n cb(null, " + callback + ")\n }\n }" + chunkName + ");\n "; | ||
var result = "require(\n " + loaderUtils.stringifyRequest(this, "!" + path.join(__dirname, "patch.js")) + "\n );\n module.exports = function(cb) { " + executor + " }\n "; | ||
return result; | ||
var chunkComment = chunkName && "/* webpackChunkName: " + _JSON$stringify(chunkName) + " */ "; | ||
return "module.exports = () => import(" + chunkComment + request + ")"; | ||
}; |
{ | ||
"name": "gatsby-module-loader", | ||
"version": "1.1.0-alpha.1460dad9", | ||
"version": "1.1.0-alpha.1a8f691e", | ||
"description": "_Based on https://github.com/webpack/bundle-loader and https://github.com/NekR/async-module-loader_", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "babel src --out-dir . --ignore __tests__", | ||
"watch": "babel -w src --out-dir . --ignore __tests__", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"prepublish": "cross-env NODE_ENV=production npm run build" | ||
"author": "Kyle Mathews <mathews.kyle@gmail.com>", | ||
"bugs": { | ||
"url": "https://github.com/gatsbyjs/gatsby/issues" | ||
}, | ||
"author": "Kyle Mathews <mathews.kyle@gmail.com>", | ||
"license": "MIT", | ||
"dependencies": { | ||
"babel-runtime": "^6.26.0", | ||
"loader-utils": "^0.2.16" | ||
"@babel/runtime": "^7.0.0-beta.38", | ||
"common-tags": "^1.4.0", | ||
"dedent": "^0.7.0", | ||
"loader-utils": "^1.0.2" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.26.0", | ||
"@babel/cli": "^7.0.0-beta.38", | ||
"@babel/core": "^7.0.0-beta.38", | ||
"cross-env": "^5.0.5" | ||
}, | ||
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-module-loader#readme", | ||
"license": "MIT", | ||
"main": "index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/gatsbyjs/gatsby.git" | ||
}, | ||
"scripts": { | ||
"build": "babel src --out-dir . --ignore __tests__", | ||
"prepublish": "cross-env NODE_ENV=production npm run build", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"watch": "babel -w src --out-dir . --ignore __tests__" | ||
} | ||
} |
@@ -1,4 +0,3 @@ | ||
"use strict"; | ||
module.exports = function () {}; | ||
module.exports = function () {}; | ||
module.exports.prototype.apply = function (compiler) { | ||
@@ -9,3 +8,2 @@ compiler.plugin("compilation", function (compilation) { | ||
var buf = []; | ||
buf.push(""); | ||
@@ -15,3 +13,2 @@ buf.push(""); | ||
buf.push(this.requireFn + ".s = installedChunks;"); | ||
return source + this.asString(buf); | ||
@@ -18,0 +15,0 @@ } |
# `gatsby-module-loader` for webpack | ||
_Based on https://github.com/webpack/bundle-loader and https://github.com/NekR/async-module-loader_ | ||
_Based on https://github.com/webpack/bundle-loader and | ||
https://github.com/NekR/async-module-loader_ | ||
Is lazy and chunk execution is always deferred + there's good error handling. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
1
7
0
2782
4
3
5
36
+ Addedcommon-tags@^1.4.0
+ Addeddedent@^0.7.0
+ Added@babel/runtime@7.26.0(transitive)
+ Addedbig.js@5.2.2(transitive)
+ Addedcommon-tags@1.8.2(transitive)
+ Addeddedent@0.7.0(transitive)
+ Addedemojis-list@3.0.0(transitive)
+ Addedjson5@1.0.2(transitive)
+ Addedloader-utils@1.4.2(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
- Removedbabel-runtime@^6.26.0
- Removedbabel-runtime@6.26.0(transitive)
- Removedbig.js@3.2.0(transitive)
- Removedcore-js@2.6.12(transitive)
- Removedemojis-list@2.1.0(transitive)
- Removedjson5@0.5.1(transitive)
- Removedloader-utils@0.2.17(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedregenerator-runtime@0.11.1(transitive)
Updatedloader-utils@^1.0.2