systeminformation icon indicating copy to clipboard operation
systeminformation copied to clipboard

OS specific exports

Open OmgImAlexis opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. When bundling my app for distribution we bundle up all the deps into a single js. Because of how this library is written we end up including all the non linux code. The issue with that is we only support linux so we're shipping a lot of extra code with no real benefit.

Describe the solution you'd like A way to use import si from 'systeminformation/linux'; as well as the normal import.

OmgImAlexis avatar Oct 18 '21 21:10 OmgImAlexis

@OmgImAlexis I like this idea! Which means that this needs quite significant refactoring. And this also makes sense to do it while I am now making the TS refactoring ... I will try to make a first partial implementation.

sebhildebrandt avatar Oct 19 '21 16:10 sebhildebrandt

So my idea with this would be to make an entry file and use the minifying and treeshaking option of esbuild to handle this. Let's wait for the TS conversion and then I'll show you my idea.

OmgImAlexis avatar Oct 19 '21 20:10 OmgImAlexis