mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-24 01:27:12 +08: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>
12 lines
539 B
JavaScript
12 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(/\/[^/]*?\/[^/]*?$/, '/');
|
|
}
|