GitBook: [master] 3 pages modified
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||

|
||||
|
||||
> **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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user