Skip to content

Commit 8fbd654

Browse files
committed
Use browserlist as esbuild target
1 parent 3d4a33c commit 8fbd654

3 files changed

Lines changed: 166 additions & 1 deletion

File tree

eleventy.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { parseHTML } from 'linkedom';
22
import slugify from '@sindresorhus/slugify';
33
import * as esbuild from 'esbuild';
4+
import browserslistToEsbuild from 'browserslist-to-esbuild';
45
import minifyHtml from '@minify-html/node';
56
import markdownIt from 'markdown-it';
67
import { bundle as lightningcssBundle, browserslistToTargets, Features } from 'lightningcss';
@@ -165,7 +166,7 @@ export default (config) => {
165166

166167
return async () => {
167168
let { outputFiles } = await esbuild.build({
168-
target: 'es2020',
169+
target: browserslistToEsbuild(packageJson.browserslist),
169170
entryPoints: [path],
170171
minify: true,
171172
bundle: true,

package-lock.json

Lines changed: 163 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"@netlify/blobs": "^10.7.4",
2929
"@shikijs/markdown-it": "^4.0.2",
3030
"@sindresorhus/slugify": "^3.0.0",
31+
"browserslist-to-esbuild": "^2.1.1",
3132
"editorconfig-checker": "^6.1.1",
3233
"esbuild": "^0.28.0",
3334
"eslint": "^10.2.0",

0 commit comments

Comments
 (0)