Skip to content

Commit

Permalink
[markdown] use build_runner to build js & wasm (#1969)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo authored Jan 15, 2025
1 parent c73ffbd commit 6e74c97
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 23 deletions.
22 changes: 6 additions & 16 deletions .github/workflows/deploy_pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,18 @@ jobs:
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94

# Build the markdown playground.
- name: "markdown: pub get"
run: dart pub get
- run: dart pub get
working-directory: pkgs/markdown
- name: "markdown: build playground"
run: >
dart compile js -o example/app.dart.js
--minify --no-frequency-based-minification --no-source-maps
example/app.dart
- run: dart run build_runner build -o example:build --release
working-directory: pkgs/markdown

# Create the _site directory.
- run: mkdir _site
- run: cp -r pkgs/markdown/example _site/markdown
- run: rm _site/markdown/*.dart
- run: cp -r pkgs/markdown/build _site/markdown

# Deploy to GitHub Pages.
- name: setup pages
uses: actions/configure-pages@v5
- name: upload artifact
uses: actions/upload-pages-artifact@v3
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: _site
- name: deploy to github pages
id: deployment
uses: actions/deploy-pages@v4
- uses: actions/deploy-pages@v4
9 changes: 2 additions & 7 deletions pkgs/markdown/.gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
# https://dart.dev/tools/pub/private-files
.dart_tool
.packages
.pub
build
pubspec.lock
doc/

example/app.dart.js
example/app.dart.js.deps
example/app.dart.js.map
19 changes: 19 additions & 0 deletions pkgs/markdown/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# See https://github.com/dart-lang/build/tree/master/build_web_compilers#configuration
targets:
$default:
builders:
build_web_compilers|dart2js_archive_extractor:
options:
filter_outputs: false
build_web_compilers|entrypoint:
generate_for:
- example/**.dart
options:
compilers:
dart2wasm:
args:
- -O4
- --no-strip-wasm
dart2js:
args:
- -O4

0 comments on commit 6e74c97

Please sign in to comment.