diff --git a/README.md b/README.md index 2fe3793..e7aaaeb 100644 --- a/README.md +++ b/README.md @@ -434,15 +434,19 @@ export function App() { ## Local Development -- Run `yarn` to install dependencies. - -- Run `yarn start` to start the development server for the package and for the example. +To start the development servers for the package and the advanced example: -- Open `localhost:5000` to view the example project. +- Run `yarn` to install dependencies. +- Run `yarn start`. +- Open `localhost:5420`. -- Run `yarn test` to execute unit tests via [Jest](https://jestjs.io). +You can also run: -- Run `yarn docs` to build the docs via [ts-doc](https://typedoc.org/). +- `start:advanced` to start development servers for the package and the advanced example. +- `start:simple` to start development servers for the package and the simple example. +- `test` to execute unit tests via [Jest](https://jestjs.io). +- `docs` to build the docs via [ts-doc](https://typedoc.org/). +- `build` to build the package. ## Example diff --git a/example-advanced/README.md b/example-advanced/README.md index ba9d93b..96d36fb 100644 --- a/example-advanced/README.md +++ b/example-advanced/README.md @@ -1,6 +1,8 @@ -# @tldraw/core-example-advanced +# @tldraw/core Advanced Example -An advanced example project with a very fast dev server. +An advanced example project for `@tldraw/core`. -You probably do not need to start the server here: it is started as -part of `yarn start` in the root directory. +To start this project: + +- run `yarn start` in the root directory +- open `http://localhost:5420` in your browser diff --git a/example-advanced/package.json b/example-advanced/package.json index 98496be..1671b23 100644 --- a/example-advanced/package.json +++ b/example-advanced/package.json @@ -10,7 +10,7 @@ "license": "MIT", "private": true, "scripts": { - "start": "node scripts/dev.mjs -w", + "start:advanced": "node scripts/dev.mjs -w", "build": "node scripts/build.mjs" }, "files": [], diff --git a/example-advanced/scripts/build.mjs b/example-advanced/scripts/build.mjs index 4ea513f..2838da7 100644 --- a/example-advanced/scripts/build.mjs +++ b/example-advanced/scripts/build.mjs @@ -18,7 +18,7 @@ async function main() { esbuild.buildSync({ entryPoints: ['./src/index.tsx'], outdir: 'dist', - minify: true, + minify: false, bundle: true, format: 'cjs', target: 'es6', diff --git a/example-advanced/scripts/dev.mjs b/example-advanced/scripts/dev.mjs index 84b0115..c92e48d 100644 --- a/example-advanced/scripts/dev.mjs +++ b/example-advanced/scripts/dev.mjs @@ -15,8 +15,8 @@ async function main() { await esbuildServe( { entryPoints: ['src/index.tsx'], + outfile: 'dist/index.js', bundle: true, - outfile: 'dist/bundle.js', minify: false, sourcemap: true, incremental: true, @@ -26,13 +26,12 @@ async function main() { }, watch: { onRebuild(err) { - serve.update() err ? error('❌ Failed') : log('✅ Updated') }, }, }, { - port: 5000, + port: 5420, root: './dist', live: true, } diff --git a/example-advanced/src/index.html b/example-advanced/src/index.html index 1da2d34..362929e 100644 --- a/example-advanced/src/index.html +++ b/example-advanced/src/index.html @@ -10,15 +10,5 @@
-