angularjs - Yoeman task "autoprefixer:dist" gets stuck -
i'm pretty new grunt workflow. have installed https://github.com/daftmonk/generator-angular-fullstack. when run grunt serve
, gets stuck @ autoprefixer:dist
task. when commented out autoprefixer
task rest of task go through , app running. not sure whats wrong. please me rid of bottle neck, i'm pretty sure 1 line answer question. here's gruntfile
'use strict'; module.exports = function(grunt) { // load grunt tasks automatically, when needed require('jit-grunt')(grunt, { express: 'grunt-express-server', useminprepare: 'grunt-usemin', ngtemplates: 'grunt-angular-templates', cdnify: 'grunt-google-cdn', protractor: 'grunt-protractor-runner', injector: 'grunt-asset-injector' }); // time how long tasks take. can when optimizing build times require('time-grunt')(grunt); // define configuration tasks grunt.initconfig({ connect: { server: { options: { port: 9000, hostname: 'localhost' }, proxies: [{ context: '/v1/', host: 'localhost', port: 8003, https: false, changeorigin: false, xforward: false }] }, livereload: { options: { middleware: function(connect, options) { if (!array.isarray(options.base)) { options.base = [options.base]; } // setup proxy var middlewares = [require('grunt-connect-proxy/lib/utils').proxyrequest]; // serve static files. options.base.foreach(function(base) { middlewares.push(connect.static(base)); }); // make directory browse-able. var directory = options.directory || options.base[options.base.length - 1]; middlewares.push(connect.directory(directory)); return middlewares; } } } }, // project settings yeoman: { // configurable paths client: require('./bower.json').apppath || 'client', dist: 'dist' }, express: { options: { port: process.env.port || 9000 }, dev: { options: { script: 'server/app.js', debug: true } }, prod: { options: { script: 'dist/server/app.js' } } }, open: { server: { url: 'http://localhost:<%= express.options.port %>' } }, watch: { injectjs: { files: [ '<%= yeoman.client %>/{app,components}/**/*.js', '!<%= yeoman.client %>/{app,components}/**/*.spec.js', '!<%= yeoman.client %>/{app,components}/**/*.mock.js', '!<%= yeoman.client %>/app/app.js' ], tasks: ['injector:scripts'] }, injectcss: { files: [ '<%= yeoman.client %>/{app,components}/**/*.css' ], tasks: ['injector:css'] }, mochatest: { files: ['server/**/*.spec.js'], tasks: ['env:test', 'mochatest'] }, jstest: { files: [ '<%= yeoman.client %>/{app,components}/**/*.spec.js', '<%= yeoman.client %>/{app,components}/**/*.mock.js' ], tasks: ['newer:jshint:all', 'karma'] }, gruntfile: { files: ['gruntfile.js'] }, livereload: { files: [ '{.tmp,<%= yeoman.client %>}/{app,components}/**/*.css', '{.tmp,<%= yeoman.client %>}/{app,components}/**/*.html', '{.tmp,<%= yeoman.client %>}/{app,components}/**/*.js', '!{.tmp,<%= yeoman.client %>}{app,components}/**/*.spec.js', '!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.mock.js', '<%= yeoman.client %>/assets/images/{,*//*}*.{png,jpg,jpeg,gif,webp,svg}' ], options: { livereload: true } }, express: { files: [ 'server/**/*.{js,json}' ], tasks: ['express:dev', 'wait'], options: { livereload: true, nospawn: true //without option specified express won't reloaded } } }, // make sure code styles par , there no obvious mistakes jshint: { options: { jshintrc: '<%= yeoman.client %>/.jshintrc', reporter: require('jshint-stylish') }, server: { options: { jshintrc: 'server/.jshintrc' }, src: ['server/{,*/}*.js'] }, all: [ '<%= yeoman.client %>/{app,components}/**/*.js', '!<%= yeoman.client %>/{app,components}/**/*.spec.js', '!<%= yeoman.client %>/{app,components}/**/*.mock.js' ], test: { src: [ '<%= yeoman.client %>/{app,components}/**/*.spec.js', '<%= yeoman.client %>/{app,components}/**/*.mock.js' ] } }, // empties folders start fresh clean: { dist: { files: [{ dot: true, src: [ '.tmp', '<%= yeoman.dist %>/*', '!<%= yeoman.dist %>/.git*', '!<%= yeoman.dist %>/.openshift', '!<%= yeoman.dist %>/procfile' ] }] }, server: '.tmp' }, // add vendor prefixed styles autoprefixer: { options: { browsers: ['last 1 version'] }, dist: { files: [{ expand: true, cwd: '.tmp/', src: '{,*/}*.css', dest: '.tmp/' }] } }, // debugging node inspector 'node-inspector': { custom: { options: { 'web-host': 'localhost' } } }, // use nodemon run server in debug mode initial breakpoint nodemon: { debug: { script: 'server/app.js', options: { nodeargs: ['--debug-brk'], env: { port: process.env.port || 9000 }, callback: function(nodemon) { nodemon.on('log', function(event) { console.log(event.colour); }); // opens browser on initial server start nodemon.on('config:update', function() { settimeout(function() { require('open')('http://localhost:8080/debug?port=5858'); }, 500); }); } } } }, // automatically inject bower components app bowerinstall: { target: { src: '<%= yeoman.client %>/index.html', ignorepath: '<%= yeoman.client %>/', exclude: [/bootstrap-sass-official/] } }, // renames files browser caching purposes rev: { dist: { files: { src: [ '<%= yeoman.dist %>/public/{,*/}*.js', '<%= yeoman.dist %>/public/{,*/}*.css', '<%= yeoman.dist %>/public/assets/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}', '<%= yeoman.dist %>/public/assets/fonts/*' ] } } }, // reads html usemin blocks enable smart builds automatically // concat, minify , revision files. creates configurations in memory // additional tasks can operate on them useminprepare: { html: ['<%= yeoman.client %>/index.html'], options: { dest: '<%= yeoman.dist %>/public' } }, // performs rewrites based on rev , useminprepare configuration usemin: { html: ['<%= yeoman.dist %>/public/{,*/}*.html'], css: ['<%= yeoman.dist %>/public/{,*/}*.css'], js: ['<%= yeoman.dist %>/public/{,*/}*.js'], options: { assetsdirs: [ '<%= yeoman.dist %>/public', '<%= yeoman.dist %>/public/assets/images' ], // update image references in our ng-templates patterns: { js: [ [/(assets\/images\/.*?\.(?:gif|jpeg|jpg|png|webp|svg))/gm, 'update js reference our revved images'] ] } } }, // following *-min tasks produce minified files in dist folder imagemin: { dist: { files: [{ expand: true, cwd: '<%= yeoman.client %>/assets/images', src: '{,*/}*.{png,jpg,jpeg,gif}', dest: '<%= yeoman.dist %>/public/assets/images' }] } }, svgmin: { dist: { files: [{ expand: true, cwd: '<%= yeoman.client %>/assets/images', src: '{,*/}*.svg', dest: '<%= yeoman.dist %>/public/assets/images' }] } }, // allow use of non-minsafe angularjs files. automatically makes // minsafe compatible uglify not destroy ng references ngmin: { dist: { files: [{ expand: true, cwd: '.tmp/concat', src: '*/**.js', dest: '.tmp/concat' }] } }, // package html partials single javascript payload ngtemplates: { options: { // should name of apps angular module module: 'fullstackapp', htmlmin: { collapsebooleanattributes: true, collapsewhitespace: true, removeattributequotes: true, removeemptyattributes: true, removeredundantattributes: true, removescripttypeattributes: true, removestylelinktypeattributes: true }, usemin: 'app/app.js' }, main: { cwd: '<%= yeoman.client %>', src: ['{app,components}/**/*.html'], dest: '.tmp/templates.js' }, tmp: { cwd: '.tmp', src: ['{app,components}/**/*.html'], dest: '.tmp/tmp-templates.js' } }, // replace google cdn references cdnify: { dist: { html: ['<%= yeoman.dist %>/*.html'] } }, // copies remaining files places other tasks can use copy: { dist: { files: [{ expand: true, dot: true, cwd: '<%= yeoman.client %>', dest: '<%= yeoman.dist %>/public', src: [ '*.{ico,png,txt}', '.htaccess', 'bower_components/**/*', 'assets/images/{,*/}*.{webp}', 'assets/fonts/**/*', 'index.html' ] }, { expand: true, cwd: '.tmp/images', dest: '<%= yeoman.dist %>/public/assets/images', src: ['generated/*'] }, { expand: true, dest: '<%= yeoman.dist %>', src: [ 'package.json', 'server/**/*' ] }] }, styles: { expand: true, cwd: '<%= yeoman.client %>', dest: '.tmp/', src: ['{app,components}/**/*.css'] } }, // run tasks in parallel speed build process concurrent: { server: [], test: [], debug: { tasks: [ 'nodemon', 'node-inspector' ], options: { logconcurrentoutput: true } }, dist: [ 'imagemin', 'svgmin' ] }, // test settings karma: { unit: { configfile: 'karma.conf.js', singlerun: true } }, mochatest: { options: { reporter: 'spec' }, src: ['server/**/*.spec.js'] }, protractor: { options: { configfile: 'protractor.conf.js' }, chrome: { options: { args: { browser: 'chrome' } } } }, env: { test: { node_env: 'test' }, prod: { node_env: 'production' }, all: require('./server/config/local.env') }, injector: { options: { }, // inject application script files index.html (doesn't include bower) scripts: { options: { transform: function(filepath) { filepath = filepath.replace('/client/', ''); filepath = filepath.replace('/.tmp/', ''); return '<script src="' + filepath + '"></script>'; }, starttag: '<!-- injector:js -->', endtag: '<!-- endinjector -->' }, files: { '<%= yeoman.client %>/index.html': [ ['{.tmp,<%= yeoman.client %>}/{app,components}/**/*.js', '!{.tmp,<%= yeoman.client %>}/app/app.js', '!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.spec.js', '!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.mock.js' ] ] } }, // inject component css index.html css: { options: { transform: function(filepath) { filepath = filepath.replace('/client/', ''); filepath = filepath.replace('/.tmp/', ''); return '<link rel="stylesheet" href="' + filepath + '">'; }, starttag: '<!-- injector:css -->', endtag: '<!-- endinjector -->' }, files: { '<%= yeoman.client %>/index.html': [ '<%= yeoman.client %>/{app,components}/**/*.css' ] } } }, }); grunt.loadnpmtasks('grunt-connect-proxy'); grunt.loadnpmtasks('grunt-autoprefixer'); // used delaying livereload until after server has restarted grunt.registertask('wait', function() { grunt.log.ok('waiting server reload...'); var done = this.async(); settimeout(function() { grunt.log.writeln('done waiting!'); done(); }, 500); }); grunt.registertask('express-keepalive', 'keep grunt running', function() { this.async(); }); grunt.registertask('serve', function(target) { if (target === 'dist') { return grunt.task.run(['build', 'env:all', 'env:prod', 'express:prod', 'open', 'express-keepalive']); } if (target === 'debug') { return grunt.task.run([ 'clean:server', 'env:all', 'concurrent:server', 'injector', 'bowerinstall', 'autoprefixer', 'concurrent:debug' ]); } grunt.task.run([ 'clean:server', 'env:all', 'concurrent:server', 'injector', 'bowerinstall', // 'autoprefixer', 'configureproxies:server', 'express:dev', 'wait', 'open', 'watch' ]); }); grunt.registertask('server', function() { grunt.log.warn('the `server` task has been deprecated. use `grunt serve` start server.'); grunt.task.run(['serve']); }); grunt.registertask('test', function(target) { if (target === 'server') { return grunt.task.run([ 'env:all', 'env:test', 'mochatest' ]); } else if (target === 'client') { return grunt.task.run([ 'clean:server', 'env:all', 'concurrent:test', 'injector', 'autoprefixer', 'karma' ]); } else if (target === 'e2e') { return grunt.task.run([ 'clean:server', 'env:all', 'env:test', 'concurrent:test', 'injector', 'bowerinstall', 'autoprefixer', 'express:dev', 'protractor' ]); } else grunt.task.run([ 'test:server', 'test:client' ]); }); grunt.registertask('build', [ 'clean:dist', 'concurrent:dist', 'injector', 'bowerinstall', 'useminprepare', 'autoprefixer', 'ngtemplates', 'concat', 'ngmin', 'copy:dist', 'cdnify', 'cssmin', 'uglify', 'rev', 'usemin' ]); grunt.registertask('default', [ 'newer:jshint', 'test', 'build' ]); };
code dir org
app/ ├── client/ ├── server/ ├── setup/ └── uploads/ ├── bower.json ├── e2e/ ├── error-log.txt ├── gruntfile.js ├── karma.conf.js ├── node_modules/ ├── package.json ├── protractor.conf.js ├── readme.md
it fact grunt-autoprefixer doesn't find files. if case block grunt:
https://github.com/ndmitry/grunt-autoprefixer/issues/115
my pr got merged , issue fixed in grunt-autoprefixer 3.0.3.
Comments
Post a Comment