Noderize Scripts
Noderize comes with commands ("scripts") built-in. These scripts are automatically added to your package.json
scripts
field when using create-noderize
:
"scripts": {
"watch": "noderize-scripts watch",
"build": "noderize-scripts build",
"start": "noderize-scripts start",
"format": "noderize-scripts format",
"test": "noderize-scripts test"
}
These scripts depend on @noderize/scripts
.
You can run Noderize's command like so:
yarn <script>
# or
npm run <script>
Note: with npm, you may omit
run
for thestart
andtest
scripts. For example:npm start
.
For the watch
and start
scripts, you may pass arguments to both Noderize and your app:
yarn watch [noderize args] -- [app args]
# or
npm run watch [noderize args] -- [app args]
If only passing arguments to your app (and not Noderize), you must add a double --
:
yarn watch -- -- [app args]
# or
npm run watch -- -- [app args]
Index
Scripts
build
Builds your apps.
Uses build options.
start
Runs your built app.
Uses run options.
watch
Continuously builds and runs your app.
Uses build & run options.
format
Format all of your code.
Uses Prettier options.
You can pass options directory to Prettier:
yarn format --useTabs
# or
npm run format --useTabs
test
Runs your tests.
Uses Jest options.
You can pass arguments directly to Jest:
yarn test --ci
# or
npm test --ci
Note: To use Noderize's build options (such as
babel
andlanguages
), you must set them to file configs.
clean
Cleans your output directory (dist
). Useful before publishing.