5 Matching Annotations
- Dec 2019
-
github.com github.com
-
One thing that matters is if code uses browser-specific (example: Dom) or server-specific (example: filesystem) features.
-
-
github.com github.com
-
It allows the module code (and subsequently dependants on the module) to not use preprocessor hacks, source code changes, or runtime detection hacks to identify which code is appropriate when creating a client bound package.
-
The browser field is where the module author can hint to the bundler which elements (other modules or source files) need to be replaced when packaging.
-
When a javascript module is prepared for use on a client there are two major concerns: certain features are already provided by the client, and certain features are not available. Features provided by a client can include http requests, websockets, dom manipulation. Features not available would include tcp sockets, system disk IO.
-
You can simply prevent a module or file from being loaded into a bundle by specifying a value of false for any of the keys. This is useful if you know certain codepaths will not be executed client side but find it awkward to split up or change the code structure.
-