There are two files that can be built:
Running npm run build
without additional arguments will build all of them. To build specific file(s), the below options can be used:
-j
,--js
,--n
,--node
,--commonjs-module
,--b
, or--browser
will buildindex.js
. Has the same effect as runningnpm run generate-js
.
This is the script loaded when yourequire("random-value-generator")
in the code. This is also usable on the web.-m
,--mjs
, or--es-module
will buildindex.mjs
. Has the same effect as runningnpm run generate-mjs
.
This is the script with ES Module support. To use it in Node.js, launch Node.js with--experimental-modules
flag, and import from"random-value-generator/index.mjs"
. To use it in website, import from"index.mjs"
.
Both options can be used in conjunction.
Files that already exist will be skipped. Use flag -f
or --force
to rebuild them regardless of when the last build happened.
The commands/options/flags are case sensitive.
- The source is
base.js
, and modifications to it will be reflected when the next build happens. - All of the files are always rebuilt before test runs.
- The required data
emoji-test.txt
for building is automatically downloaded if it isn't in thebuild-scripts/
folder.