Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gatsby-module-loader

Package Overview
Dependencies
Maintainers
2
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-module-loader - npm Package Compare versions

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc