question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: allow additional settings from package.json config

See original GitHub issue

Do you want to request a feature or report a bug?

feature request

What is the current behavior?

The library loads settings like this:

  • One path and one maxSize from CLI options, OR
  • An array of path/maxSize settings from package.json at key bundlesize
  • An API token via ci-env and process.env settings
  • (other sources in elsewhere in code?)

If this is a feature request, what is motivation or use case for changing the behavior?

Two-part request:

  1. permit more settings to come from package.json
  2. collate all the config setting sources together in src/config.js, and use those where needed in code.

I have a specific setting I’d like to request, but in deference to the contribution guide, here’s our discussion issue first. 😃

Also my feature is semi-trivial, but the existing code doesn’t easily allow extra settings. So to fix that, I have already done a proof of concept over here. It includes all the changes I guessed were necessary to allow more configuration. I also added unit tests via jest in addition to self-exercise test script that was inline in the current package.json file.

I picked jest rather than a more minimal testing framework for its ease of mocking require statements. Because the library uses both package.json parsing and commander argv parsing, I thought it was worthwhile.

Please mention other relevant information.

  • node version 8.4
  • npm version 5.4
  • Operating system Linux/ WSL-windows
  • bundlesize version 0.15.3
  • CI you are using: Circle

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
siddharthkpcommented, Jun 29, 2019

Implemented in https://github.com/siddharthkp/bundlesize/pull/316 and published in 0.18.0 🎉

Check out README for details

0reactions
sethbattincommented, Oct 25, 2017

Sorry for my confusion here, but I don’t know what you are intending. Should I submit a PR, or wait for those other tickets, or what?

Read more comments on GitHub >

github_iconTop Results From Across the Web

runInBand to package.json options · Issue #3215 ... - GitHub
This is a feature request. I currently have a setup that involves jest tests asyncronously creating and re-aliasing elasticsearch indices ...
Read more >
package.json - npm Docs
This document is all you need to know about what's required in your package.json file. It must be actual JSON, not just a...
Read more >
Contribution Points | Visual Studio Code Extension API
Contribution Points. Contribution Points are a set of JSON declarations that you make in the contributes field of the package.json Extension Manifest.
Read more >
Configuration options | Yarn - Package Manager
Enabling this setting also unlocks some features (for example the yarn add command will suggest to reuse the same dependencies as other workspaces...
Read more >
next.config.js: Introduction
learn more about the configuration file used by Next.js to handle your application. ... file in the root of your project directory (next...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found