fantasywind / generator-angular-jade-stylus Goto Github PK
View Code? Open in Web Editor NEWThis project forked from yeoman/generator-angular
Change repo to https://github.com/fantasywind/generator-angular-jscg
This project forked from yeoman/generator-angular
Change repo to https://github.com/fantasywind/generator-angular-jscg
再麻煩請修正了,謝謝。
js: {
files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
tasks: ['newer:jshint:all'],
options: {
livereload: '<%= connect.options.livereload %>'
}
},
// build:js({.tmp,app}) scripts/main.js
script(src="scripts/app.js")
insert respond.js to support media query on IE8
Just created an app.
Ran grunt build.
No "concat" targets found.
Warning: Task "concat" failed. Use --force to continue.
Aborted due to warnings.
I built an app with Yeoman, using generator-angular-jade-stylus, and everything worked perfectly in the development version using grunt serve
, not a single error in the console, but upon building the app with grunt serve:dist
, my app turns into a blank page, with the following error in the console:
66e3c8ac.vendor.js:4 Uncaught Error: Failed to instantiate module monopolyApp due to: Error: [$injector:nomod] Module 'monopolyApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.2.15/$injector/nomod?p0=mon... at http://localhost:9000/scripts/66e3c8ac.vendor.js:4:12729 at http://localhost:9000/scripts/66e3c8ac.vendor.js:4:20410 at b (http://localhost:9000/scripts/66e3c8ac.vendor.js:4:19993) at http://localhost:9000/scripts/66e3c8ac.vendor.js:4:20305 at http://localhost:9000/scripts/66e3c8ac.vendor.js:4:27065 at Array.forEach (native) at f (http://localhost:9000/scripts/66e3c8ac.vendor.js:4:13059) at k (http://localhost:9000/scripts/66e3c8ac.vendor.js:4:27005) at Fa (http://localhost:9000/scripts/66e3c8ac.vendor.js:4:28542) at e (http://localhost:9000/scripts/66e3c8ac.vendor.js:4:18649)
What I have tried:
I have done quite a bit of research on this error, and found a few fixes, but none of them worked for me...One of them mentioned that useminPrepare would minify the scripts, and then uglify would minify the scripts again, corrupting the scripts, and they said to remove uglify from the useminPrepare block to solve it. I tried this and it just gave me an error that it could not find the uglify task, and aborted.
I found another fix that said to change <!-- build:js scripts/vendor.js -->
to <!-- build:js(app/..) scripts/vendor.js -->
or <!-- build:js(./) scripts/vendor.js -->
-- Using this method removed the errors from the console, but still left me with a blank page.
I have the module correctly attached to the body- body(ng-app="monopolyApp")
and this is how my module is defined in the app.js:
angular .module('monopolyApp', [ 'ngCookies', 'ngResource', 'ngSanitize', 'ngRoute', 'LocalStorageModule' ])
and in the controller (main.js):
angular.module('monopolyApp') .controller('MainCtrl', function ($scope, $window, $timeout, localStorageService) {
I have also included the index.jade, app.js, and main.js in this gist for further reference. If any further information is needed to diagnose this error please let me know, but I have tried every fix I can find and nothing is working. All I can imagine is that something is going wrong in the concatenation process. Any help is appreciated, thanks!
Edit
I just tried to startup another new app, with the default template that comes after you run the generator the first time, did not edit a single line of the code, and used grunt serve:dist
and got the same blank page problem and same error in the console, so it would appear this is a problem with the generator itself and not my code.
Can you please push a new version of this so npm has the correct npm info (specifically that this isn't a Yeoman team project)?
Hi
`grunt test' gives you this:
No provider for “framework:jasmine”! (Resolving: framework:jasmine)
Following this SO post will get them running:
But then there are syntax errors running the tests I suspect they're not happy with Coffeescript. Will dig more later..
0.8.5: I got this working by editing my Gruntfile like so:
stylus: {
files: ['<%= yeoman.app %>/styles/{,*/}*.styl'],
tasks: ['stylus:server', 'autoprefixer']
},
and
livereload: {
options: {
livereload: '<%= connect.options.livereload %>'
},
files: [
'<%= yeoman.app %>/{,*/}*.html',
'<%= yeoman.app %>/{,*/}*.jade',
'.tmp/styles/{,*/}*.css',
'.tmp/scripts/{,*/}*.js',
'<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
]
}
Cheers.
After first setup
yo angular-jade-stylus --jade --stylus myApp
without even changing anything
if I run grunt build
everything is done without errors, but checking .tmp/concat/scripts/main.js
is EMPTY so uglify just gets this empty file and minifies nothing :)
thi is copied from the console
concat:
{ generated:
{ files:
[ { dest: '.tmp\\concat\\scripts\\vendor.js',
src:
[ 'app\\bower_components\\jquery\\dist\\jquery.js',
'app\\bower_components\\es5-shim\\es5-shim.js',
'app\\bower_components\\angular\\angular.js',
'app\\bower_components\\json3\\lib\\json3.min.js',
'app\\bower_components\\bootstrap\\dist\\js\\bootstrap.js',
'app\\bower_components\\angular-resource\\angular-resource.js',
'app\\bower_components\\angular-cookies\\angular-cookies.js',
'app\\bower_components\\angular-sanitize\\angular-sanitize.js',
'app\\bower_components\\angular-route\\angular-route.js',
'app\\bower_components\\angular-bootstrap\\ui-bootstrap-tpls.js' ] },
{ dest: '.tmp\\concat\\scripts\\main.js',
src:
[ '.tmp\\scripts\\app.js',
'.tmp\\scripts\\controllers\\main.js' ] } ] } }
it looks like that the .tmp\scripts folder is not there at all
The command yo angular-jade-stylus:route myroutegenerate .html instead of .jade
I try with adding --jade wihout success.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.