Comments (10)
If you want, I'm working on a "functioning" version with ngAnnotate
. Once I have it properly running, I could send it to you for verification s.t. you can then update the yeoman scaffolding. (unfortunately I didn't yet write any Yeoman generator and don't currently have the time to get into it - although I'd like)
from generator-angular-require.
That would be amazing! Why not fork the code and do this as a pull request?
from generator-angular-require.
Fixed in https://github.com/aaronallport/generator-angular-require/releases/tag/v0.2.6 - This has been published to NPM, but will look to replace ngmin with ngAnnotate soon
from generator-angular-require.
I've sorted this in release v0.2.7 (https://github.com/aaronallport/generator-angular-require/releases/tag/v0.2.7) - ngAnnotate output is written to .tmp, and r.js pick up the files from there for optimising and writes them to the usal place under/dist/scripts
from generator-angular-require.
👍 Awesome. Will check out your modifications and test them. Thx!
from generator-angular-require.
You're very welcome. As an aside, I'd love to hear about what you're using this generator for. Keen to see the cool stuff people do with it!
from generator-angular-require.
Seems like this fix has some problems.
While ngAnnotate is executed correctly resulting in having all of the ngAnnotate-processed JS files in the .tmp/scripts
folder, the requirejs
task is executed on the actual source instead of the ngAnnotated one.
I had to change the requirejs
task from
// r.js compile config
requirejs: {
dist: {
options: {
dir: '<%= yeoman.dist %>/scripts/',
modules: [{
name: 'main'
}],
preserveLicenseComments: false, // remove all comments
removeCombined: true,
baseUrl: '<%= yeoman.app %>/scripts',
mainConfigFile: '.tmp/<%= yeoman.app %>/scripts/main.js',
optimize: 'uglify2',
uglify2: {
mangle: false
}
}
}
}
to
// r.js compile config
requirejs: {
dist: {
options: {
dir: '<%= yeoman.dist %>/scripts/',
modules: [{
name: 'main'
}],
preserveLicenseComments: false, // remove all comments
removeCombined: true,
baseUrl: '.tmp/<%= yeoman.app %>/scripts',
mainConfigFile: '.tmp/<%= yeoman.app %>/scripts/main.js',
optimize: 'uglify2',
uglify2: {
mangle: false
}
}
}
}
Moreover, to have the r.js
minification work properly, I had to introduce a copy
task that copied the bower_components
to the .tmp
folder.
I think you could also switch the mangle: false
to true to get an even better compression as with ngAnnotate should fix the DI issue.
The bower_components are not copied correctly to the dist
directory. This is probably because the bower root folder has been moved from inside the app/
to the application root. Consequently the line bower_components/**/*
doesn't match any folder.
dist: {
files: [{
expand: true,
dot: true,
cwd: '<%= yeoman.app %>',
dest: '<%= yeoman.dist %>',
src: [
'*.{ico,png,txt}',
'.htaccess',
'*.html',
'views/{,*/}*.html',
'bower_components/**/*',
'images/{,*/}*.{webp}',
'fonts/*'
]
}
There is a part further down in the copy:dist
task but it only copies the sass fonts. Changing it to
{
expand: true,
cwd: '.',
src: 'bower_components/**',
dest: '<%= yeoman.dist %>'
}
(btw, how do you test your yeoman generator locally?? So I could send a pull-request directly next time)
from generator-angular-require.
I'll take a look at this - thanks for your great response! I'll try and answer your points soon. I'm almost done with the re-factoring using class-extend (much like yeoman/generator-backbone)
sorry for not replying sooner
from generator-angular-require.
Sorry, I'm still trying to get the re-factored tests running on the generator-cleanup branch. Once this is done I'll turn my attention to sorting issues.
As for running locally to test, clone the repo, and from within the generator-angular-require top-level directory, run "npm link" - this should create a link so that when creating and navigating in to a directory such as "generator-ang-req-playground", running "yo angular-require" will use the version from your machine. It might be a good idea to uninstall the generator-angular-require package from your machine first.
Cheers,
Aaron
from generator-angular-require.
Released in 0.3.0
from generator-angular-require.
Related Issues (20)
- Added generator-angular-require to comparison of starters HOT 2
- On newly generated, package.json has "grunt-filerev": "^0.2.2", version doesn't exist HOT 6
- Lazy loading controllers HOT 2
- when I run 'grunt build', it's has a error HOT 2
- JQuery... How to add in the require.config so can load before angular? HOT 2
- Path to long in MSBUILD Task UTF-8-Validate HOT 1
- Grunt and Requierejs? HOT 2
- Support namespace support for angular module HOT 3
- RequireJS can't find angularjs and the other angular modules (ngRoute, ngResource) HOT 6
- angular-ui-router addition HOT 2
- Avoid combining script to single js file HOT 1
- Fix tests HOT 1
- Getting dependency errors of grunt & karma HOT 1
- Angular Modules' quotes being displayed as html entities
- Add typescript version of generator files HOT 1
- How to structuring a project with mulitple app ?
- use the generator,show "Uncaught ReferenceError: ngCookies is not defined" HOT 2
- installing on git bash HOT 1
- yo angular-require [project name] installation error HOT 1
- came out without warning
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generator-angular-require.