aui / art-template-loader

art-template loader for webpack
MIT License
107 stars 33 forks source link

是否支持动态添加过滤器? #4

Closed zcoding closed 7 years ago

zcoding commented 7 years ago

目前过滤器只能通过 imports 选项传给 art-template ,这里主要有两个问题:

  1. 在开发环境,如果在 webpack 运行期间添加过滤器,webpack 并不会更新过滤器,模板文件访问过滤器失败,通过重新启动 webpack 才能获取到
  2. 初始化过滤器的代码,并不能使用 import 语法,导致这部分代码难以维护(因为我的业务代码用了 babel+ES2015,导致没办法在初始化过滤器的代码中复用业务代码)

我是参考 example 里面的方式做的,不知道是不是我的方式有误,求指教~

另:我个人的想法是, art-template 应该支持动态添加过滤器,而不是必须通过 options 初始化所有的过滤器。

aui commented 7 years ago

好建议,我考虑优化这里。不降低性能损耗的同时支持运行时载入过滤器

aui commented 7 years ago

已经支持,使用请见 README.md