GitBook: [master] 3 pages modified

This commit is contained in:
resir014
2018-09-21 11:57:49 +00:00
committed by gitbook-bot
parent afe6c29583
commit 3370233670
3 changed files with 16 additions and 8 deletions

View File

@@ -18,7 +18,9 @@ The authentication token is pulled by the starter kit from a file named `screeps
cp screeps.sample.json screeps.json 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 ## Generating an auth token

View File

@@ -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. 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) {% 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.
> **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. {% endhint %}
## Running your first deploy ## Running your first deploy

View File

@@ -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 ```bash
npm install --save-dev cross-env 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. {% 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.
> **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`. {% 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. 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.