Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a vanilla TS project built with Rsbuild #149

Merged
merged 7 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/check-typescript-projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
- lit-ts
- parcel-ts
- rollup-ts
- rsbuild-ts
- sveltekit-ts
- vitejs-ts
npm-package: ['release', 'development']
Expand Down
271 changes: 267 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions projects/rsbuild-ts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Local
.DS_Store
*.local
*.log*

# Dist
node_modules
dist/

# IDE
.vscode/*
!.vscode/extensions.json
.idea
20 changes: 20 additions & 0 deletions projects/rsbuild-ts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Rsbuild Project

A vanilla TypeScript project built with https://rsbuild.dev

Initialized by following https://rsbuild.dev/guide/start/quick-start:
- `npm create rsbuild@latest`
- this used [email protected]

## Setup

From the repository root, run `npm install`. For more details, see the [root README](../../README.md#setup).

If you want to use the maxGraph development version (built locally), see the [root README](../../README.md#maxgraph-dev-version) about maxGraph integration.

## Running the project

From the repository root, run `npm run dev -w projects/rsbuild-ts` and go to http://localhost:3000/

If you want to bundle the application, run `npm run build -w projects/rsbuild-ts` and then run `npm run preview -w projects/rsbuild-ts`
to access to a preview of the bundled application.
11 changes: 11 additions & 0 deletions projects/rsbuild-ts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "maxgraph-ts-example-built-with-rsbuild",
"scripts": {
"dev": "rsbuild dev --open",
"build": "rsbuild build",
"preview": "rsbuild preview"
},
"devDependencies": {
"@rsbuild/core": "1.0.1-beta.14"
}
}
23 changes: 23 additions & 0 deletions projects/rsbuild-ts/rsbuild.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { defineConfig } from '@rsbuild/core';

export default defineConfig({
html: {
favicon: './src/assets/favicon-128x128.png',
title: 'maxGraph Rsbuild TypeScript example',
},
output: {
// ensure assets are correctly loaded when the application is not at the root of the server, for examples when it is deployed on GitHub pages.
assetPrefix: 'auto',
}
// enforce a chunk per module to better track the size of the maxGraph chunk.
// We don't need it here because we have a single dependency, so the chunk automatically generated only includes the maxGraph module.
// In addition, this also split chunks for the CSS files, which is not what we want (at least for now).
// https://rsbuild.dev/guide/optimization/split-chunk#split-by-module
// performance: {
// chunkSplit: {
// strategy: 'split-by-module',
// },
// },
});


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading