-
Notifications
You must be signed in to change notification settings - Fork 248
Best practice to reduce js output file size? #1695
Comments
Neither. The angular/di transformers takes care of all that. What kind of output size are you seeing? |
@bgourlie Here is my name: aristadart
description: A sample web application
dependencies:
angular: any
browser: any
di: any
fp: any
googleapis: any
googleapis_auth: any
http: any
mongo_dart: any
redstone: any
redstone_mapper: any
redstone_mapper_mongo: any
route_hierarchical: '>=0.5.0 <0.7.0'
sass: '>=0.4.0 <0.5.0'
script_inliner: '>=1.0.0 <2.0.0'
shelf_static: any
stack_trace: any
unittest: any
transformers:
- redstone_mapper
- angular:
html_files:
- lib/components/login/login.html
- lib/components/login/nuevo_usuario.html
- lib/components/home/home.html
- lib/components/evento/evento.html
- lib/components/vista/vista.html
- lib/components/vista/construccion_ra/construccion_ra.html
- lib/components/admin/admin.html
- lib/components/admin/model.html
- lib/components/admin/target.html
- lib/components/widgets/loader/loader.html
- lib/components/widgets/alert/alert.html
- lib/components/widgets/dummy/dummy.html
- script_inliner
- sass:
style: compressed
copy-sources: true
- $dart2js:
$exclude: bin and my library aristadart.main;
import 'package:angular/angular.dart';
import 'package:angular/routing/module.dart';
import 'package:angular/application_factory.dart';
import 'package:logging/logging.dart';
import 'package:redstone_mapper/mapper_factory.dart';
import 'package:aristadart/arista_client.dart';
@MirrorsUsed(targets: const[
'angular',
'angular.core',
'angular.core.dom',
'angular.filter',
'angular.perf',
'angular.directive',
'angular.routing',
'angular.core.parser',
'NodeTreeSanitizer'
],
override: '*')
import 'dart:mirrors';
class MyAppModule extends Module
{
MyAppModule()
{
bind (AristaLoader);
bind (LoginVista);
bind (HomeVista);
bind (EventoVista);
bind (VistaVista);
bind (VistaConstruccionRA);
bind (NuevoUsuarioVista);
bind (AdminVista);
bind (ModelVista);
bind (TargetVista);
bind (Acordeon);
bind (TituloDinamico);
bind (RouteInitializerFn, toValue: recipeBookRouteInitializer);
bind (NgRoutingUsePushState, toValue: new NgRoutingUsePushState.value(false));
}
}
void main()
{
bootstrapMapper();
Logger.root.level = Level.FINEST;
Logger.root.onRecord.listen((LogRecord r) { print(r.message); });
applicationFactory()
.addModule(new MyAppModule())
.rootContextType (MainController)
.run();
} |
You need to use the angular transformer as illustrated here. |
@bgourlie |
That's odd... what version of angular are you using? |
@bgourlie |
@bgourlie |
It must be another package... perhaps check to see if any of the other packages you're referencing import |
@bgourlie Thanks for the help :) |
I don't think removing the transformer will fix it. AFAIK, if there is a reference to |
If you are using the transformer AND are not using mirrors elsewhere, use: @MirrorsUsed(override: '*')
import 'dart:mirrors'; That tells dart2js not to retain symbols for any library. |
Searching I've seen tricks like this
or like this
It could even be neither. What is the ACTUAL best practice to get small js output?
The text was updated successfully, but these errors were encountered: