Fix build config for web worker example

This commit is contained in:
Simon Binder 2022-06-28 14:47:32 +02:00
parent 440753d5e3
commit 4fae017d36
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
2 changed files with 23 additions and 7 deletions

View File

@ -1,16 +1,31 @@
targets:
# We use dartdevc by default, but the worker should always be compiled with dart2js
# This setup exists so that the main entrypoint (web/main.dart) gets compiled
# with dartdevc for debug builds while the worker is compiled with dart2js
# (since workers don't support the JS moduled emitted by dartdevc).
# In release builds (`--release` on the CLI), both entrypoints are compiled
# with dart2js.
#
# If you're ok with compiling everything with dart2js, just use
# `compiler: dartj2s` on the options of the default target and ignore the two
# additional targets here.
dart2js_archives:
auto_apply_builders: false
dependencies: [":$default", ":worker"]
builders:
build_web_compilers:dart2js_archive_extractor:
enabled: true
worker:
auto_apply_builders: false
dependencies: [":$default"]
builders:
build_web_compilers|entrypoint:
build_web_compilers:entrypoint:
enabled: true
generate_for:
- web/worker.dart
- web/worker.dart
options:
compiler: dart2js
build_web_compilers:dart2js_archive_extractor:
enabled: false
$default:
builders:
@ -22,8 +37,11 @@ targets:
generate_values_in_copy_with: true
named_parameters: true
new_sql_code_generation: true
build_web_compilers|entrypoint:
build_web_compilers:entrypoint:
generate_for:
# This one is compiled in the other target
exclude:
- "web/worker.dart"
# We have a designated target for this step.
build_web_compilers:dart2js_archive_extractor:
enabled: false

View File

@ -166,8 +166,6 @@ class Entries extends Table with TableInfo<Entries, Entrie> {
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
List<Set<GeneratedColumn>> get uniqueKeys => [];
@override
Entrie map(Map<String, dynamic> data, {String? tablePrefix}) {
return Entrie.fromData(data,
prefix: tablePrefix != null ? '$tablePrefix.' : null);