gpt4 book ai didi

angular - Dartlang:pubspec.yaml中的Dev Transformers

转载 作者:行者123 更新时间:2023-12-03 03:43:20 25 4
gpt4 key购买 nike

我想知道是否有可能在pubspec.yaml文件中定义“仅开发”转换器。

我的问题是:

我在单独的存储库中有一些angular2组件。我在他们各自的example文件夹中为他们写了一些示例。为了运行这些示例,我在examples文件夹中有一个入口点html文件,该文件引导了angular2应用程序。

为此,我必须将此输入点文件包含在angular2的转换器中,如下所示:

transformers:
- angular2:
entry_points:
- example/breakpoint_consumer/breakpoint_consumer.html

一切都很好。但是,当我想稍后在另一个项目中使用该组件时,示例文件夹将不会被拉入。这是一件好事,但是pub告诉我,它无法在示例文件夹内找到入口点。

我认为有可能简单地忽略该错误,因为它没有做任何事情。但是,无论如何,还是很高兴知道的:)

最佳答案

不直接支持dev_transformers
https://github.com/dart-lang/pub/issues/1260#issuecomment-163065340

As of ef743d5, pub will fully ignore dependencies' transformers that use $include to ensure that they only run on non-public files, even if those transformers come from dev dependencies. This allows you to effectively have "dev transformers" by restricting transformers to test/ or web/.

关于angular - Dartlang:pubspec.yaml中的Dev Transformers,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42042195/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com