-
Notifications
You must be signed in to change notification settings - Fork 26
use sass with Angular/Closure #11
Comments
There's no build system here yet, so the obvious first step is just to invoke the sass compiler directly, and update the Angular components to reference the output I'm working on open-sourcing the rules we use with http://bazel.build which includes SASS and that will be a better story. I don't know about stitching together some other build tooling, but unless you're an enthusiast I don't recommend trailblazing some new combination of tools. |
OK, I'll try it manually first. Tnks |
I'm having trouble making it work, I'm getting these messegas for all external imports:
I'm using latest version of Google Closure Compiler and I do have them listed in the config, just as this repo:
Any ideas? |
@ianchi that doesn't seem related to using Sass. Can you narrow the problem down by making your setup more similar to the one in this repo until you see what's different? Or, post a repro that I can try. |
certainly not Sass related. I was trying to replicate the logic from this repo to my own project. |
@alexeagle the problem is the new 20170626 version of Closure Compiler.
|
Thanks for tracking it down. There was already a different breakage with an
earlier version, google/closure-compiler#2487
We have some work to do to fix closure compiler and add missing CI so it
doesn't get broken again.
…On Tue, Jul 18, 2017 at 8:09 AM Adrián Panella ***@***.***> wrote:
@alexeagle <https://github.com/alexeagle> the problem is the new 20170626
version of Closure Compiler.
This repo also breaks with the same error if you update to that version.
> ***@***.*** closure /home/ianchi/dev/ianchi_wrt/closure-demo
> java -jar node_modules/google-closure-compiler/compiler.jar --flagfile closure.conf
built/app.module.js:1: ERROR - required "module$$angular$core" namespace never provided
import { NgModule } from ***@***.***/core';
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAC5I-zDSEEFrKhTKtBBvI7HSrUQDrHfks5sPMqQgaJpZM4OaiwI>
.
|
@alexeagle I'm setting up a new Angular project and I'd like to use Angular with Bazel and Closure. I can confirm that the angular/closure-demo build fails with the latest google-closure-compiler: 20170806.0.0
The last working version is 20170409.0.0. Any updates up this? Is there anything I can do to help out? I have a repo up at https://github.com/gregmagolan/angular-clusure-build that I'm working from. I've also checked out your Angular Bazel build example (https://github.com/alexeagle/angular-bazel-example) using the new bazelbuild/rules_typescript. What would be required to get that working with closure? Presumably, https://github.com/bazelbuild/rules_closure, would not work with Angular and TypeScript yet. On a side note, I really like your clang-format for TypeScript suggestion. First time I've used it and its great! |
@gregmagolan we raised the priority of this last week because Angular 5 will need some commits from closure-compiler so we have to get on the latest release. @thelgevold looked into it some. I think someone needs to run the Java debugger against the compiler to figure it out. Do you have some time to try? For your other question, see bazelbuild/rules_typescript#6 |
Any progress on the ClosureCompiler side of things @alexeagle @thelgevold for supporting 5.0.0? |
Angular 5 still relies on my fork of closure compiler, we are hoping to get a closure compiler release with everything working in time for Angular 5 RC. |
Will you please update the conf on your demo repo @alexeagle when the time comes so ClosureCompiler noobs like me can figure out at a glance how to update? I took your advice from ng-conf and looked into what @Mlaval did, worked in similar logic to this build and it would be nice to have an example for RC to look at so I can quickly update and test the changes. |
@ianchi you can see an example of triggering sass compilation, then ngc, then closure compiler in this repo: https://github.com/steveblue/angular2-rollup |
Thanks @steveblue |
re. not much of a size improvement - can you share any details? Was that
with ADVANCED_OPTIMIZATIONS?
…On Mon, Sep 18, 2017 at 2:55 PM Adrián Panella ***@***.***> wrote:
Thanks @steveblue <https://github.com/steveblue>
I did manage to make a manual build, but didn't find that much of size
improvements.
Since then, the "build optimizer" was added to angular-cli, and I ended
with better results using Webpack, so I switched back to that.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAC5I34e4GlRsRPsJY-JaUapH_jvVh4jks5sjubGgaJpZM4OaiwI>
.
|
I mean comparing with the "ng build optimizer" builds. (which is a much simpler workflow). I dind't tried ADVANCED_OPTIMIZATIONS because I need all the API to be available for additional "plugins" that are compiled outside the main module, and lazy loaded on demand. |
Ah, it's expected that anything less than ADVANCED_OPTIMIZATIONS is not
really worth doing, it just does dead code removal which other tools also
know how to do.
If you had asked, we could have shown you how to make your plugins
available outside the bundle by preventing the renaming of their
properties, but I understand if you've moved on now.
…On Mon, Sep 18, 2017 at 3:20 PM Adrián Panella ***@***.***> wrote:
I mean comparing with the "ng build optimizer" builds. (which is a much
simpler workflow).
I don't have the numbers now, as I did the test about a month ago, and
then abandoned Closure.
I dind't tried ADVANCED_OPTIMIZATIONS because I need all the API to be
available for additional "plugins" that are compiled outside the main
module, and lazy loaded on demand.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAC5I-fzazSTRu3uYvQy2E_EPyRTjI0fks5sjuzEgaJpZM4OaiwI>
.
|
Please show us how anyways @alexeagle. There are others who are using ClosureCompiler |
It's a long topic... The manual way is to create an externs file Angular itself ships with these - for example an Angular app minified by closure must not rename the The better way is to generate externs with tsickle. We do this at google by marking external interfaces as |
I was doing proof of concept of the size the production bundle would have. |
OK @alxhub I am indeed invoking the manual method for now with a file where externs are declared, nice to know we are on track with |
I think this issue should be closed, the topic is not based on the original issue and besides, you can compile SCSS just fine down to CSS prior to ngc running. |
thanks @steveblue |
@alexeagle thank for your great work explaining how to try Closure Compiler with Angular.
Could you hint the best way to integrate sass compiler into this building system not using Webpack.
Could I preprocess everything with Rollup and then Closure or start using Gulp with some task to replace references of .scss files in components'
styleUrls
with compiled .css ones before callingngc
?Any other simpler way?
The text was updated successfully, but these errors were encountered: