From 421d51831f986ebed0247f24527b9b451f02e463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Vlatkovi=C4=87?= <390700+ivandotv@users.noreply.github.com> Date: Wed, 6 Mar 2024 19:36:58 +0100 Subject: [PATCH] Remove development code from README.md --- README.md | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/README.md b/README.md index bf9016c..31ab4a7 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ Opinionated template repository for creating Javascript libraries with Typescrip - [Motivation](#motivation) - [Getting Started](#getting-started) - [Compiling Typescript via Microbundle](#compiling-typescript-via-microbundle) -- [Development code](#development-code) - [Testing via Vitest](#testing-via-vitest) - [Linting and Formatting code via Biome](#linting-via-biome) - [Continuous Integration](#continuous-integration) @@ -41,43 +40,6 @@ Microbundle creates three bundles, `modern (es6)` `cjs` and `umd`. Also in the ` - `import` - es6 (module) build of the library - `require` - Commonjs build of the library -## Development code - -While in the development you have access to a few expressions, that will later be transformed via microbundle. - -`__DEV__` expression: Write code that will be stripped out from the production build. - -this code: - -```js -if (__DEV__) { - //dev only code -} -``` - -will generate: - -```js -if (process.env.NODE_ENV !== 'production') { - //dev only code -} -``` - -Which will later (in `production` mode) be resolved to: - -```js -if (false) { - //dev only code -} -``` - -And it will be removed from your `production` build. - -There are also some other expressions that you can use: - -- `__VERSION__` is replaced with the environment variable `PKG_VERSION` or with `package.json` `version` field. -- `__COMMIT_SHA__` is replaced with the short version of the git commit SHA from the HEAD. -- `__BUILD_DATE__` is replaced with the date of the commit from the HEAD. ## Testing via Vitest