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

webpack-runtime-public-path-plugin

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-runtime-public-path-plugin - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

39

index.js

@@ -6,5 +6,16 @@ /**

function RuntimePublicPath(options) {
this.options = options
this.options = options;
this._name = 'WebpackRuntimePublicPathPlugin';
}
RuntimePublicPath.prototype.apply = function(compiler) {
function buf(path, source) {
var buf = [];
buf.push(source);
buf.push('');
buf.push('// Dynamic assets path override (webpack-runtime-public-path-plugin)');
buf.push('__webpack_require__.p = (' + path + ') || __webpack_require__.p;');
return buf.join('\n');
}
RuntimePublicPath.prototype.apply = function (compiler) {
var runtimePublicPathStr = this.options && this.options.runtimePublicPath;

@@ -15,14 +26,18 @@ if (!runtimePublicPathStr) {

}
compiler.plugin('this-compilation', function(compilation) {
compilation.mainTemplate.plugin('require-extensions', function(source, chunk, hash) {
var buf = [];
buf.push(source);
buf.push('');
buf.push('// Dynamic assets path override (webpack-runtime-public-path-plugin)');
buf.push('__webpack_require__.p = (' + runtimePublicPathStr + ') || __webpack_require__.p;');
return buf.join('\n');
if (compiler.hooks && compiler.hooks.thisCompilation) {
compiler.hooks.thisCompilation.tap(this._name, function (compilation) {
compilation.mainTemplate.plugin('require-extensions', function (source, chunk, hash) {
return buf(runtimePublicPathStr, source)
});
});
});
} else {
compiler.plugin('this-compilation', function (compilation) {
compilation.mainTemplate.plugin('require-extensions', function (source, chunk, hash) {
return buf(runtimePublicPathStr, source)
});
});
}
};
module.exports = RuntimePublicPath;
module.exports = RuntimePublicPath;
{
"name": "webpack-runtime-public-path-plugin",
"version": "1.1.1",
"version": "1.1.2",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

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