1

I am getting the following errors when compiling my web-app with DDC:

SEVERE] build_web_compilers|ddc on package:sass/sass.dartdevc.module (cached):
Error compiling dartdevc module:sass|lib/sass.ddc.js

[error] Target of URI doesn't exist: 'node/interface.dart'. (package:sass/src/importer/node.dart, line 5, col 8)
[error] The exported library ''node/interface.dart'' can't have a part-of directive. (package:sass/src/importer/node.dart, line 5, col 8)
[error] Target of URI doesn't exist: 'io/interface.dart'. (package:sass/src/io.dart, line 7, col 8)
[error] Target of URI doesn't exist: 'io/interface.dart'. (package:sass/src/io.dart, line 12, col 8)
[error] The exported library ''io/interface.dart'' can't have a part-of directive. (package:sass/src/io.dart, line 12, col 8)
[error] Target of URI doesn't exist: 'package:package_resolver/package_resolver.dart'. (package:sass/src/sync_package_resolver.dart, line 1, col 8)

Im not really sure what I need. I have a dart file named compiler-sass.dart with the following code:

import 'dart:io';
import 'package:sass/sass.dart' as sass;

void main(List<String> arguments) {
  var result = sass.compile(arguments[0]);
  new File(arguments[1]).writeAsStringSync(result);
}

If I manually compile my sass files it works but not with the command:

webdev serve --hot-reload

My pubspec has the following dependencies:

dependencies:
  path: ^1.4.1
  sass: ^1.16.1
  vue: ^0.4.1
  build_runner: ^1.1.2
  build_web_compilers: ^1.0.0
  intl: ^0.15.7

What am I missing here? Why doesnt it work?

Asperger
  • 3,064
  • 8
  • 52
  • 100
  • What values are in `arguments[0]` and `arguments[0]`)? Perhaps you want https://pub.dartlang.org/packages/sass_builder instead anyway. – Günter Zöchbauer Jan 31 '19 at 08:55
  • @GünterZöchbauer well I can manually do a sass compilation with the following command: "dart compile-sass.dart styles.scss styles.css". Which means that arguments[0] is the path to styles.scss and arguments[1] styles.css. It works perfectly but I somehow need to make the compilation work with DDC. So that if I use webdev build or webdev serve it auto-transpiles everything for me. – Asperger Jan 31 '19 at 09:32
  • 1
    That would be sass_builder – Günter Zöchbauer Jan 31 '19 at 09:33
  • 1
    @GünterZöchbauer that was the answer, thank you! – Asperger Jan 31 '19 at 10:06

1 Answers1

1

https://pub.dartlang.org/packages/sass_builder integrates directly with webdev to incrementally only build what changed and what the browser fetches.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567