biofriction-wp-theme/node_modules/webpack/lib/runtime/PublicPathRuntimeModule.js

31 lines
671 B
JavaScript
Raw Normal View History

2021-10-26 14:18:09 +02:00
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const RuntimeModule = require("../RuntimeModule");
class PublicPathRuntimeModule extends RuntimeModule {
constructor() {
super("publicPath", RuntimeModule.STAGE_BASIC);
}
/**
* @returns {string} runtime code
*/
generate() {
const { compilation } = this;
const { publicPath } = compilation.outputOptions;
return `${RuntimeGlobals.publicPath} = ${JSON.stringify(
this.compilation.getPath(publicPath || "", {
hash: this.compilation.hash || "XXXX"
})
)};`;
}
}
module.exports = PublicPathRuntimeModule;