mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[ts] Updated README on ES6 modules.
This commit is contained in:
parent
7e55ccabd6
commit
e464a9fbba
@ -40,6 +40,18 @@ All `*.js` files are self-contained and include both the core and respective bac
|
||||
|
||||
If you write your app with TypeScript, additionally copy the corresponding `build/spine-*.d.ts` file to your project.
|
||||
|
||||
**Note:** If you are using the compiled `.js` files with ES6 or other module systems, you have to add
|
||||
|
||||
```
|
||||
export { spine };
|
||||
```
|
||||
|
||||
At the bottom of the `.js` file you are using. You can then import the module as usual, e.g.:
|
||||
|
||||
```
|
||||
import { spine } from './spine-webgl.js';
|
||||
```
|
||||
|
||||
## Examples
|
||||
To run the examples, the image, atlas, and JSON files must be served by a webserver, they can't be loaded from your local disk. Spawn a light-weight web server in the root of spine-ts, then navigate to the `index.html` file for the example you want to view. E.g.:
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user