diff options
author | silverwind <me@silverwind.io> | 2020-01-25 09:41:34 +0100 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2020-01-25 16:41:34 +0800 |
commit | 5b17bb8f3dbc180c72446000d82ba06fd7349dc7 (patch) | |
tree | f75eda7a6b1094a239769e8c4d7b9bbc010d1f07 /templates | |
parent | 89f7dcb13d8cc8be9615004a2ce5a476c14bc8e6 (diff) | |
download | gitea-5b17bb8f3dbc180c72446000d82ba06fd7349dc7.tar.gz gitea-5b17bb8f3dbc180c72446000d82ba06fd7349dc7.zip |
add css extraction and minification to webpack (#9944)
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>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/pwa/serviceworker_js.tmpl | 30 | ||||
-rw-r--r-- | templates/swagger/ui.tmpl | 1 |
2 files changed, 17 insertions, 14 deletions
diff --git a/templates/pwa/serviceworker_js.tmpl b/templates/pwa/serviceworker_js.tmpl index 31180b7692..096628f2f0 100644 --- a/templates/pwa/serviceworker_js.tmpl +++ b/templates/pwa/serviceworker_js.tmpl @@ -1,36 +1,38 @@ var STATIC_CACHE = 'static-cache-v1'; var urlsToCache = [ // js - '{{StaticUrlPrefix}}/vendor/plugins/jquery.areyousure/jquery.are-you-sure.js', '{{StaticUrlPrefix}}/fomantic/semantic.min.js?v={{MD5 AppVer}}', + '{{StaticUrlPrefix}}/js/gitgraph.js', '{{StaticUrlPrefix}}/js/index.js?v={{MD5 AppVer}}', - '{{StaticUrlPrefix}}/js/swagger.js?v={{MD5 AppVer}}', - '{{StaticUrlPrefix}}/js/gitgraph.js?v={{MD5 AppVer}}', '{{StaticUrlPrefix}}/js/jquery.js?v={{MD5 AppVer}}', + '{{StaticUrlPrefix}}/js/swagger.js?v={{MD5 AppVer}}', '{{StaticUrlPrefix}}/vendor/plugins/clipboard/clipboard.min.js', - '{{StaticUrlPrefix}}/vendor/plugins/vue/vue.min.js', - '{{StaticUrlPrefix}}/vendor/plugins/emojify/emojify.custom.js', - '{{StaticUrlPrefix}}/vendor/plugins/cssrelpreload/loadCSS.min.js', + '{{StaticUrlPrefix}}/vendor/plugins/codemirror/addon/mode/loadmode.js', + '{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/meta.js', '{{StaticUrlPrefix}}/vendor/plugins/cssrelpreload/cssrelpreload.min.js', + '{{StaticUrlPrefix}}/vendor/plugins/cssrelpreload/loadCSS.min.js', '{{StaticUrlPrefix}}/vendor/plugins/dropzone/dropzone.js', + '{{StaticUrlPrefix}}/vendor/plugins/emojify/emojify.custom.js', '{{StaticUrlPrefix}}/vendor/plugins/highlight/highlight.pack.js', + '{{StaticUrlPrefix}}/vendor/plugins/jquery.areyousure/jquery.are-you-sure.js', '{{StaticUrlPrefix}}/vendor/plugins/jquery.datetimepicker/jquery.datetimepicker.js', '{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.min.js', - '{{StaticUrlPrefix}}/vendor/plugins/codemirror/addon/mode/loadmode.js', - '{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/meta.js', '{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.js', + '{{StaticUrlPrefix}}/vendor/plugins/vue/vue.min.js', // css + '{{StaticUrlPrefix}}/css/gitgraph.css', + '{{StaticUrlPrefix}}/css/index.css?v={{MD5 AppVer}}', + '{{StaticUrlPrefix}}/css/swagger.css?v={{MD5 AppVer}}', + '{{StaticUrlPrefix}}/fomantic/semantic.min.css?v={{MD5 AppVer}}', '{{StaticUrlPrefix}}/vendor/assets/font-awesome/css/font-awesome.min.css', '{{StaticUrlPrefix}}/vendor/assets/octicons/octicons.min.css', - '{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.css', - '{{StaticUrlPrefix}}/vendor/plugins/tribute/tribute.css', - '{{StaticUrlPrefix}}/fomantic/semantic.min.css?v={{MD5 AppVer}}', - '{{StaticUrlPrefix}}/css/index.css?v={{MD5 AppVer}}', + '{{StaticUrlPrefix}}/vendor/plugins/dropzone/dropzone.css', '{{StaticUrlPrefix}}/vendor/plugins/highlight/github.css', - '{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.css', '{{StaticUrlPrefix}}/vendor/plugins/jquery.datetimepicker/jquery.datetimepicker.css', - '{{StaticUrlPrefix}}/vendor/plugins/dropzone/dropzone.css', + '{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.css', + '{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.css', + '{{StaticUrlPrefix}}/vendor/plugins/tribute/tribute.css', {{if .IsSigned }} {{ if ne .SignedUser.Theme "gitea" }} '{{StaticUrlPrefix}}/css/theme-{{.SignedUser.Theme}}.css?v={{MD5 AppVer}}', diff --git a/templates/swagger/ui.tmpl b/templates/swagger/ui.tmpl index 41ed06e7f6..9072b49a37 100644 --- a/templates/swagger/ui.tmpl +++ b/templates/swagger/ui.tmpl @@ -3,6 +3,7 @@ <head> <meta charset="UTF-8"> <title>Gitea API</title> + <link href="{{StaticUrlPrefix}}/css/swagger.css?v={{MD5 AppVer}}" rel="stylesheet"> <style> html { box-sizing: border-box; |