Skip to content

Commit 6e74c97

Browse files
authored
[markdown] use build_runner to build js & wasm (#1969)
1 parent c73ffbd commit 6e74c97

File tree

3 files changed

+27
-23
lines changed

3 files changed

+27
-23
lines changed

.github/workflows/deploy_pages.yaml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,18 @@ jobs:
2626
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
2727

2828
# Build the markdown playground.
29-
- name: "markdown: pub get"
30-
run: dart pub get
29+
- run: dart pub get
3130
working-directory: pkgs/markdown
32-
- name: "markdown: build playground"
33-
run: >
34-
dart compile js -o example/app.dart.js
35-
--minify --no-frequency-based-minification --no-source-maps
36-
example/app.dart
31+
- run: dart run build_runner build -o example:build --release
3732
working-directory: pkgs/markdown
3833

3934
# Create the _site directory.
4035
- run: mkdir _site
41-
- run: cp -r pkgs/markdown/example _site/markdown
42-
- run: rm _site/markdown/*.dart
36+
- run: cp -r pkgs/markdown/build _site/markdown
4337

4438
# Deploy to GitHub Pages.
45-
- name: setup pages
46-
uses: actions/configure-pages@v5
47-
- name: upload artifact
48-
uses: actions/upload-pages-artifact@v3
39+
- uses: actions/configure-pages@v5
40+
- uses: actions/upload-pages-artifact@v3
4941
with:
5042
path: _site
51-
- name: deploy to github pages
52-
id: deployment
53-
uses: actions/deploy-pages@v4
43+
- uses: actions/deploy-pages@v4

pkgs/markdown/.gitignore

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1+
# https://dart.dev/tools/pub/private-files
12
.dart_tool
2-
.packages
3-
.pub
3+
build
44
pubspec.lock
5-
doc/
6-
7-
example/app.dart.js
8-
example/app.dart.js.deps
9-
example/app.dart.js.map

pkgs/markdown/build.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# See https://github.com/dart-lang/build/tree/master/build_web_compilers#configuration
2+
targets:
3+
$default:
4+
builders:
5+
build_web_compilers|dart2js_archive_extractor:
6+
options:
7+
filter_outputs: false
8+
build_web_compilers|entrypoint:
9+
generate_for:
10+
- example/**.dart
11+
options:
12+
compilers:
13+
dart2wasm:
14+
args:
15+
- -O4
16+
- --no-strip-wasm
17+
dart2js:
18+
args:
19+
- -O4

0 commit comments

Comments
 (0)