diff options
author | silverwind <me@silverwind.io> | 2020-06-28 04:59:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-27 22:59:56 -0400 |
commit | 7761245d087c9477ea7f3e50c60daecd6cc6ec14 (patch) | |
tree | ad8884856cef8ccae786f3889cd9a51486a8b738 /templates/base | |
parent | 2281b048af8837a33adfc9acfd3872022c789026 (diff) | |
download | gitea-7761245d087c9477ea7f3e50c60daecd6cc6ec14.tar.gz gitea-7761245d087c9477ea7f3e50c60daecd6cc6ec14.zip |
Move fomantic and jQuery to main webpack bundle (#11997)
This saves around 3 MB binary size by not including useless fomantic
files in the build. Also, this allows us to move jQuery into the main
bundle as well which eliminates a few HTTP requests.
Also included are webpack config changes:
- split less and css loaders to speed up compliation
- enable css sourcemaps
- switch css minfier plugin to cssnano-webpack-plugin which works better
for sourcemaps than the previous plugin
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'templates/base')
-rw-r--r-- | templates/base/footer.tmpl | 9 | ||||
-rw-r--r-- | templates/base/head.tmpl | 1 |
2 files changed, 3 insertions, 7 deletions
diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index 6570a6eaed..e7d8c46f88 100644 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -11,8 +11,6 @@ {{template "custom/body_outer_post" .}} {{template "base/footer_content" .}} - - <script src="{{StaticUrlPrefix}}/js/jquery.js?v={{MD5 AppVer}}"></script> {{if .RequireSimpleMDE}} <script src="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.js"></script> <script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/addon/mode/loadmode.js"></script> @@ -23,9 +21,6 @@ {{end}} <!-- Third-party libraries --> -{{if .RequireMinicolors}} - <script src="{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.min.js"></script> -{{end}} {{if .RequireU2F}} <script src="{{StaticUrlPrefix}}/vendor/plugins/u2f/index.js"></script> {{end}} @@ -34,8 +29,10 @@ <script src='{{ URLJoin .RecaptchaURL "api.js"}}' async></script> {{end}} {{end}} - <script src="{{StaticUrlPrefix}}/fomantic/semantic.min.js?v={{MD5 AppVer}}"></script> <script src="{{StaticUrlPrefix}}/js/index.js?v={{MD5 AppVer}}"></script> +{{if .RequireMinicolors}} + <script src="{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.min.js"></script> +{{end}} {{template "custom/footer" .}} </body> </html> diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index 0f575233aa..7999eebb11 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -95,7 +95,6 @@ {{if .RequireSimpleMDE}} <link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.css"> {{end}} - <link rel="stylesheet" href="{{StaticUrlPrefix}}/fomantic/semantic.min.css?v={{MD5 AppVer}}"> <link rel="stylesheet" href="{{StaticUrlPrefix}}/css/index.css?v={{MD5 AppVer}}"> <noscript> <style> |