CLI vendor-bundle rebundle


#1

My question is almost the same as in https://github.com/aurelia/cli/issues/361 topic

I have separate repo with plugins that are used across all my projects. Plugins are bundled and it works great. But after modifying any of “plugin” files CLI never update vendor-bundle.js file. The only way is to stop and then run all the build tasks again…

Does anyone know solution or have any gulp task utilizing some of the CLI bundler features?

Thanks in advance


#2

I haven’t tried this, but you could add your own watches to the watching list in aurelia_project/tasks/watch.ts

In my watch.ts (CLI v0.32), there is a watches array which could be added to. The question is what to do with the files once imported? If they’re .ts files then probably transpile; if markup then processMarkup (assuming your source globs are scoped to the file type). I’d be thinking something like this:

let watches = [
  ... // 3 existing ones
  { name: 'plugins-ts', callback: transpile, source: "../plugins/**/*.ts"},
  { name: 'plugins-html', callback: processMarkup, source: "../plugins/**/*.ts"}
]