Conversation
252959a to
ba276eb
Compare
|
Simplified some of the "path-ing" |
index.html
Outdated
|
|
||
| <app-component></app-component> | ||
|
|
||
| <script src="bazel-out/darwin-fastbuild/bin/src/rollup.runfiles/angular_bazel_example/dist/bundle.js"></script> |
There was a problem hiding this comment.
I suppose this example ought to come with a <10 line express server so that the bundle can be served from the same URL as it would be under ts_devserver
There was a problem hiding this comment.
My trick is just to have a ts_devserver which doesn't actually produce a bundle itself but instead lists the production bundle as a static resource.
There was a problem hiding this comment.
I have added configuration to match the url of ts_devserver
README.md
Outdated
| Experimental Production bundling with Rollup: | ||
|
|
||
| ```bash | ||
| $ bazel run src:rollup |
There was a problem hiding this comment.
thinking out loud: we'll need to set users expectations about whether we'd ever support code splitting and lazy loading with a rollup setup. It's probably hard and not worth it since we'd be creating a new capability in that toolchain?
/cc @robwormald
| "protractor": "5.2.2", | ||
| "typescript": "2.6.2" | ||
| "typescript": "2.6.2", | ||
| "rollup": "0.52.3", |
There was a problem hiding this comment.
when this shapes up more, the user shouldn't be exposed to the rollup npm dependencies
rollup-bundle.js
Outdated
|
|
||
| class NormalizePaths { | ||
| // TODO Fix import statements in ngfactories to avoid this path plugin | ||
| resolveId(importee, importer) { |
There was a problem hiding this comment.
if we didn't have to patch filepaths, is there a way to just call the rollup CLI without having our own main like this?
src/rollup.bzl
Outdated
| def _rollup(ctx): | ||
|
|
||
| args = ["--config", "../../../../execroot/angular_bazel_example/rollup.config.js"] | ||
| args += ["--output.file", ctx.outputs.build.path] |
There was a problem hiding this comment.
I would like to avoid path navigation like this, but I am not sure how to best navigate the folder structure or pass files along to rules.
|
The bundling is a three step process (Rollup, TS downleveling, Uglify). I currently run this as three different bazel commands, but I am assuming we could simplify I have not figured out how to do that in Bazel though |
|
Updated the url to match the url of |
77dc888 to
a2d790e
Compare
s s s s s s s s s s s s s s s s s s s
|
We worked through this together, your fork is the master copy right now. Let's design how to land the real rollup rule |
WIP: DO NOT MERGE!
This is a wip PR to get some feedback on the approach.
TODOS: