Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7163527
D1415.id4678.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D1415.id4678.diff
View Options
diff --git a/swh/web/assets/config/webpack-plugins/generate-weblabels-webpack-plugin/index.js b/swh/web/assets/config/webpack-plugins/generate-weblabels-webpack-plugin/index.js
--- a/swh/web/assets/config/webpack-plugins/generate-weblabels-webpack-plugin/index.js
+++ b/swh/web/assets/config/webpack-plugins/generate-weblabels-webpack-plugin/index.js
@@ -99,6 +99,12 @@
}
}
+ // remove webpack loader call if any
+ let loaderEndPos = srcFilePath.indexOf('!');
+ if (loaderEndPos !== -1) {
+ srcFilePath = srcFilePath.slice(loaderEndPos + 1);
+ }
+
// iterate on all chunks containing the module
mod.chunks.forEach(chunk => {
@@ -171,8 +177,12 @@
// process additional scripts if needed
if (this.options['additionalScripts']) {
for (let script of Object.keys(this.options['additionalScripts'])) {
+ let scriptFilesData = this.options['additionalScripts'][script];
+ if (!script.startsWith('http:') && !script.startsWith('https:')) {
+ script = stats.publicPath + script;
+ }
this.chunkJsAssetToSrcFiles[script] = [];
- for (let scriptSrc of this.options['additionalScripts'][script]) {
+ for (let scriptSrc of scriptFilesData) {
let scriptSrcData = {'id': scriptSrc['id']};
let licenceFilePath = scriptSrc['licenseFilePath'];
let parsedSpdxLicenses = this.parseSpdxLicenseExpression(scriptSrc['spdxLicenseExpression'],
@@ -182,7 +192,11 @@
scriptSrcData['licenses'].forEach(license => {
license['copy_url'] = licenseCopyUrl;
});
- scriptSrcData['src_url'] = stats.publicPath + path.join(this.weblabelsDirName, scriptSrc['id']);
+ if (!scriptSrc['path'].startsWith('http:') && !scriptSrc['path'].startsWith('https:')) {
+ scriptSrcData['src_url'] = stats.publicPath + path.join(this.weblabelsDirName, scriptSrc['id']);
+ } else {
+ scriptSrcData['src_url'] = scriptSrc['path'];
+ }
this.chunkJsAssetToSrcFiles[script].push(scriptSrcData);
this.copyFileToOutputPath(scriptSrc['path']);
}
@@ -341,7 +355,9 @@
}
copyFileToOutputPath(srcFilePath, ext = '') {
- if (this.copiedFiles.has(srcFilePath)) {
+ if (this.copiedFiles.has(srcFilePath) ||
+ srcFilePath.startsWith('http:') ||
+ srcFilePath.startsWith('https:')) {
return;
}
let destPath = this.cleanupPath(srcFilePath);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 30, 9:54 AM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3219152
Attached To
D1415: Add support for client side rendering of Jupyter notebooks
Event Timeline
Log In to Comment