danielroe / siroc

Zero-config build tooling for Node
MIT License
152 stars 4 forks source link

feat: transpile browser bundle #197

Open pi0 opened 3 years ago

pi0 commented 3 years ago

🆒 Your use case Add a description of your use case, and how this feature would help you.

It is totally fine that we push using modern syntax by default. But mostly for browsers, it might be hard for making utilities that requires users to transpile for browser.

🆕 The solution you'd like

Support target option in siroc.config per-entry. (transpiling with esbuild)

target: {
  main: 'node14',
  browser: 'chrome80'
}

(example above is not esbuild valid targets)

🔍 Alternatives you've considered

ℹī¸ Additional info

danielroe commented 3 years ago

nb to self: may be blocked by evanw/esbuild#297

pi0 commented 3 years ago

If install size is not much matter, bable env (as an outout plugin) may do the trick for browser 😁