Skip to content

Commit

Permalink
allow other conditional imports
Browse files Browse the repository at this point in the history
  • Loading branch information
yjbanov committed Dec 13, 2024
1 parent b471224 commit 81816cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion web_sdk/sdk_rewriter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ List<Replacer> generatePartsPatterns(String libraryName, bool isPublic) {
// Remove library directives.
AllReplacer(RegExp(r'\nlibrary .+;'), ''),
// Remove imports/exports from all part files.
AllReplacer(RegExp(r"\nimport '.+'\n\s*if \(dart.library.html\) '.*';"), ''),
AllReplacer(RegExp(r"\nimport '.+'\n\s*if \(dart\.library\..*\) '.*';"), ''),
AllReplacer(RegExp(r'\nimport\s*.*'), ''),
AllReplacer(RegExp(r'\nexport\s*.*'), ''),
AllReplacer(RegExp(r'\n@DefaultAsset(.*)'), ''),
Expand Down
2 changes: 2 additions & 0 deletions web_sdk/test/sdk_rewriter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ void printSomething() {
import 'package:some_package/some_package.dart';
import 'package:ui/src/engine/skwasm/skwasm_impl.dart'
if (dart.library.html) 'package:ui/src/engine/skwasm/skwasm_stub.dart';
import 'package:ui/src/engine/skwasm/skwasm_impl.dart'
if (dart.library.js_interop) 'package:ui/src/engine/skwasm/skwasm_stub.dart';
import 'package:some_package/some_package' as some_package;
void printSomething() {
Expand Down

0 comments on commit 81816cc

Please sign in to comment.