From 33702336706e7c0b74efe1ad9b9808a89d1c7ea8 Mon Sep 17 00:00:00 2001 From: resir014 Date: Fri, 21 Sep 2018 11:57:49 +0000 Subject: [PATCH] GitBook: [master] 3 pages modified --- docs/getting-started/authenticating.md | 4 +++- docs/getting-started/deploying.md | 6 +++--- docs/in-depth/cookbook/environment-variables.md | 14 ++++++++++---- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/docs/getting-started/authenticating.md b/docs/getting-started/authenticating.md index ad4fe7b..b510bcc 100644 --- a/docs/getting-started/authenticating.md +++ b/docs/getting-started/authenticating.md @@ -18,7 +18,9 @@ The authentication token is pulled by the starter kit from a file named `screeps cp screeps.sample.json screeps.json ``` -> **IMPORTANT:** The `screeps.json` file contains your Screeps credentials. If you use any source control, **DO NOT** check in this file into your repository. +{% hint style="danger" %} +**IMPORTANT:** The `screeps.json` file contains your Screeps credentials! If you use any source control to store your codebase, **DO NOT** check in this file into your repository. +{% endhint %} ## Generating an auth token diff --git a/docs/getting-started/deploying.md b/docs/getting-started/deploying.md index cfb5870..40353ca 100644 --- a/docs/getting-started/deploying.md +++ b/docs/getting-started/deploying.md @@ -6,9 +6,9 @@ The starter kit builds your code using `rollup`, which uses a `screeps.json` fil The `screeps.json` file is a JSON configuration file separated into multiple environments. We're going to focus on the `main` environment to get you started. If you'd like to deploy to a different branch, be sure to change the `branch` key to the branch you'd like to deploy to. -![authenticating-4](../.gitbook/assets/authenticating-4.png) - -> **Note:** You don't have to manually create the target branch in your Screeps client if it doesn't exist yet. `rollup-plugin-screeps` will do it for you. +{% hint style="info" %} +You don't have to manually create the target branch in your Screeps client if it doesn't exist yet. `rollup-plugin-screeps` will do it for you. +{% endhint %} ## Running your first deploy diff --git a/docs/in-depth/cookbook/environment-variables.md b/docs/in-depth/cookbook/environment-variables.md index 9342c5c..ebd57d0 100644 --- a/docs/in-depth/cookbook/environment-variables.md +++ b/docs/in-depth/cookbook/environment-variables.md @@ -40,7 +40,9 @@ Then we'll change the build tasks on `package.json` to pass the environment vari } ``` -**Note:** On Windows, setting the environment variables as defined above will not work. For a cross-platform solution to define environment variables, use `cross-env`. +{% hint style="warning" %} +On Windows, setting the environment variables as defined above will not work. For a cross-platform solution to define environment variables, use `cross-env`. +{% endhint %} ```bash npm install --save-dev cross-env @@ -91,9 +93,13 @@ export default { }; ``` -> **Note:** Generally, you need to ensure that `rollup-plugin-replace` goes _before_ other plugins, so we can be sure Rollup replaces these variables correctly and the remaining plugins can apply any optimisations \(e.g. dead code elimination\) correctly. -> -> **Note:** Because these values are evaluated once as a string \(for the find-and-replace\), and once as an expression, they need to be wrapped in `JSON.stringify`. +{% hint style="info" %} +Generally, you need to ensure that `rollup-plugin-replace` goes _before_ other plugins, so we can be sure Rollup replaces these variables correctly and the remaining plugins can apply any optimisations \(e.g. dead code elimination\) correctly. +{% endhint %} + +{% hint style="warning" %} +Because these values are evaluated once as a string \(for the find-and-replace\), and once as an expression, they need to be wrapped in `JSON.stringify`. +{% endhint %} Variables set by this plugin will be replaced in the actual output JS code. When compiling your code, Rollup will replace the variable names with the output of the supplied expression or value.