nihalgonsalves / esbuild-plugin-browserslist Goto Github PK
View Code? Open in Web Editor NEWConfigure esbuild targets based on a browserslist query
License: MIT License
Configure esbuild targets based on a browserslist query
License: MIT License
'use strict'
const browserslist = require('browserslist')
const {
resolveToEsbuildTarget
} = require('esbuild-plugin-browserslist')
const target = resolveToEsbuildTarget(
browserslist('default', {
printUnknownTargets: false
})
)
console.log(target)
C:\wamp64\www\AdminLTE-ts\node_modules\browserslist\index.js:1179
throw unknownQuery(name)
^
Error [BrowserslistError]: Unknown browser query `default`. Maybe you are using old Browserslist or made typo in query.
at unknownQuery (C:\wamp64\www\AdminLTE-ts\node_modules\browserslist\index.js:285:10)
at Function.select (C:\wamp64\www\AdminLTE-ts\node_modules\browserslist\index.js:1179:15)
at C:\wamp64\www\AdminLTE-ts\node_modules\browserslist\index.js:336:33
at Array.reduce (<anonymous>)
at resolve (C:\wamp64\www\AdminLTE-ts\node_modules\browserslist\index.js:318:18)
at browserslist (C:\wamp64\www\AdminLTE-ts\node_modules\browserslist\index.js:444:21)
at Object.<anonymous> (C:\wamp64\www\AdminLTE-ts\build\config\esbuild.config.js:9:3)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32) {
browserslist: true
}
The following browserslist query:
"last 3 Chrome major versions",
"last 3 Safari major versions",
"unreleased Chrome versions",
"unreleased Safari versions"
Resolves to include:
...
safari TP
Which then is logged by esbuild-plugin-browserslist
:
Could not parse Browserslist result to a meaningful format. entry=safari TP
The equivalent browsers for chrome do not cause esbuild-plugin-browserslist
to emit such a log.
I believe that esbuild-plugin-browserslist
should be updated to resolve this browser version into an esbuild target.
Thanks!
Can I load browserslist config in either package.json
or the .browserslistrc
via resolveToEsbuildTarget
?
Attempting to use this plugin with newer versions of esbuild (v0.14) throws a package version error during install.
Could the package's version of esbuild be set to allow newer versions: ^0.13.0
instead of ~0.13.0
?
esbuild-plugin-browserslist/package.json
Line 46 in 48ae897
If not, could the esbuild version used in this package be bumped to v0.14?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.