Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull esbuild configuration from package.json entry #5

Open
dpilafian opened this issue Jul 24, 2021 · 2 comments
Open

Pull esbuild configuration from package.json entry #5

dpilafian opened this issue Jul 24, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@dpilafian
Copy link

New Feature

For extra convenience (and to reduce the clutter of yet another project configuration file), add support for storing the esbuild configuration directly in the project's package.json file.

Something like:

package.json

  ...
  "esbuildConfig": {
    "entry": "./index.js",
    "outfile": "./bundle.js",
    "external": ["react", "react-dom"],
    "loader": { ".js": "jsx", ".png": "base64" },
    "minify": true
  },
  "scripts": {
    "build": "esbuild $(esbuild-config package.json:esbuildConfig)"
  },
  ...
@bpierre
Copy link
Owner

bpierre commented Jul 24, 2021

Good idea!

We could even drop the package.json:esbuildConfig and check the package.json if no esbuild.config.json is present and no file path has been passed.

For the key, I think it would be safe to use "esbuild" directly, since esbuild doesn’t plan to support config files.

@bpierre bpierre added the enhancement New feature or request label Jul 24, 2021
@dpilafian
Copy link
Author

Yeah, that's even better -- simple and works automatically.

@alirazabhutta alirazabhutta mentioned this issue Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants