From d5ef25c62df134855d48322a633982577dd6d5dd Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sat, 30 Jul 2022 20:40:46 +0200 Subject: Set the language target to `es2015` --- CHANGELOG.md | 4 ++++ layouts/partials/scripts.html | 2 +- layouts/partials/seo/ga.html | 2 +- layouts/shortcodes/form-search.html | 6 +----- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c1b792..2f2b96e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Provide annotation support via https://hypothes.is +### Changed + +- Set the language target to `es2015` when build JavaScript. + ### Fixed - Fix opening external links in new tab/window when use diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index a42e492..2d8e543 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -4,7 +4,7 @@ {{- $scripts = $scripts | append (resources.Get "js/ed.js") -}} {{- $scripts = $scripts | resources.Concat "js/common.js" -}} -{{- $scripts = $scripts | js.Build (dict "format" "iife" "minify" $isProduction) -}} +{{- $scripts = $scripts | js.Build (dict "format" "iife" "target" "es2015" "minify" $isProduction) -}} {{- if or (site.Params.assets.disable_fingerprinting) (not $isProduction) }} diff --git a/layouts/partials/seo/ga.html b/layouts/partials/seo/ga.html index a9703b3..5fcde75 100644 --- a/layouts/partials/seo/ga.html +++ b/layouts/partials/seo/ga.html @@ -6,7 +6,7 @@ {{- $gaScript = $gaScript | append (resources.Get "js/ga.js") -}} {{- $gaScript = $gaScript | resources.Concat "js/analytics-bundle.js" -}} - {{- $gaScript = $gaScript | js.Build (dict "format" "iife" "minify" true "params" $gaParams) -}} + {{- $gaScript = $gaScript | js.Build (dict "format" "iife" "target" "es2015" "minify" true "params" $gaParams) -}} {{- if site.Params.assets.disable_fingerprinting }} diff --git a/layouts/shortcodes/form-search.html b/layouts/shortcodes/form-search.html index a917aec..9276030 100644 --- a/layouts/shortcodes/form-search.html +++ b/layouts/shortcodes/form-search.html @@ -76,11 +76,7 @@ {{- $siteSearch = $siteSearch | append (resources.Get "js/search.js") -}} {{- $siteSearch = $siteSearch | resources.Concat "js/search-bundle.js" -}} -{{- if $isProduction -}} - {{- $siteSearch = $siteSearch | js.Build (dict "format" "iife" "params" $searchParams) | minify -}} -{{ else }} - {{- $siteSearch = $siteSearch | js.Build (dict "format" "iife" "sourceMap" "inline" "params" $searchParams) -}} -{{- end -}} +{{- $siteSearch = $siteSearch | js.Build (dict "format" "iife" "minify" $isProduction "target" "es2015" "params" $searchParams) -}} {{- if or (site.Params.assets.disable_fingerprinting) (not $isProduction) }} -- cgit v1.2.3