Skip to content
This repository was archived by the owner on Oct 17, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,7 @@
exports[`java projects correctly generates JS module 1`] = `
"
var link = document.createElement(\\"link\\");

var preload;

try {
preload = link.relList.supports(\\"preload\\");
}
catch (error) {
preload = false;
}

if (preload) {
link.setAttribute(\\"as\\", \\"style\\");
link.setAttribute(\\"rel\\", \\"preload\\");
}
else {
link.setAttribute(\\"rel\\", \\"stylesheet\\");
}

link.setAttribute(\\"rel\\", \\"stylesheet\\");
link.setAttribute(\\"type\\", \\"text/css\\");
link.setAttribute(\\"href\\", Liferay.ThemeDisplay.getPathContext() + \\"/o/java-project/file.css\\");

Expand Down Expand Up @@ -49,24 +32,7 @@ module.exports = link;
exports[`standard projects correctly generates JS module 1`] = `
"
var link = document.createElement(\\"link\\");

var preload;

try {
preload = link.relList.supports(\\"preload\\");
}
catch (error) {
preload = false;
}

if (preload) {
link.setAttribute(\\"as\\", \\"style\\");
link.setAttribute(\\"rel\\", \\"preload\\");
}
else {
link.setAttribute(\\"rel\\", \\"stylesheet\\");
}

link.setAttribute(\\"rel\\", \\"stylesheet\\");
link.setAttribute(\\"type\\", \\"text/css\\");
link.setAttribute(\\"href\\", Liferay.ThemeDisplay.getPathContext() + \\"/o/a-project/file.css\\");

Expand Down
19 changes: 1 addition & 18 deletions packages/liferay-npm-bundler-loader-css-loader/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,7 @@ export default function(
// returns both pathProxy and the context path of the portal's webapp.
context.extraArtifacts[`${filePath}.js.wrap-modules-amd.template`] = `
var link = document.createElement("link");

var preload;

try {
preload = link.relList.supports("preload");
}
catch (error) {
preload = false;
}

if (preload) {
link.setAttribute("as", "style");
link.setAttribute("rel", "preload");
}
else {
link.setAttribute("rel", "stylesheet");
}

link.setAttribute("rel", "stylesheet");
link.setAttribute("type", "text/css");
link.setAttribute("href", Liferay.ThemeDisplay.getPathContext() + "${href}");

Expand Down