mirror of
https://github.com/go-gitea/gitea
synced 2024-11-25 18:12:48 +01:00
5b17bb8f3d
This changes the CSS output of webpack to output to the public/css directory instead of inling CSS in JS. This enables CSS minification and autoprefixer based on browserslist which would otherwise not be possible. The result of this change is two new output files currently: - public/css/swagger.css - public/css/gitgraph.css Co-authored-by: techknowlogick <matti@mdranta.net>
11 lines
539 B
JavaScript
11 lines
539 B
JavaScript
/* This sets up webpack's chunk loading to load resources from the 'public'
|
|
directory. This file must be imported before any lazy-loading is being attempted. */
|
|
|
|
if (document.currentScript && document.currentScript.src) {
|
|
const url = new URL(document.currentScript.src);
|
|
__webpack_public_path__ = url.pathname.replace(/\/[^/]*?\/[^/]*?$/, '/');
|
|
} else {
|
|
// compat: IE11
|
|
const script = document.querySelector('script[src*="/index.js"]');
|
|
__webpack_public_path__ = script.getAttribute('src').replace(/\/[^/]*?\/[^/]*?$/, '/');
|
|
}
|