gruntjs

How to define individual flows in useminPrepare for each block in html file?

血红的双手。 提交于 2019-12-03 06:22:05
We have 2 blocks defined in our index.html - one for 3rd party libs and one for our application files. Since 3rd party libs are already minified, we just want to concatenate them, but not uglify. How can I do this with useminPrepare ? <!-- build:js js/lib.js --> <script src="lib/angular/angular.min.js"></script> <script src="lib/angular-cookies/angular-cookies.min.js"></script> <script src="lib/angular-route/angular-route.min.js"></script> <!-- endbuild --> <!-- build:js js/app.js --> <script src="js/app.js"></script> <script src="js/controllers/LanguageCtrl.js"></script> <!-- endbuild -->

front end development workflow with angularjs and gruntjs

ぃ、小莉子 提交于 2019-12-03 06:13:04
I wanted to know how the front end development workflow is organized when we use HTML 5 and angularjs. We use a Jetty java back end (Cannot be changed), and we want to expose restful services which the angularjs can consume. With angularjs it so happens that the main page needs to include many js files, most of which are application specific, we intend to split the application logically in js files. So how would you recommend having the front end development workflow ?, in order to avoid handling so many different js files a colleague has suggested the use of minification of js files using

arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6')

我只是一个虾纸丫 提交于 2019-12-03 06:10:18
Currently I'm running my tests with protractor/grunt but I'm getting the follow error message: 'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6'). I think my .jshintrc file is not being read, because I've added this condition. .jshintrc { "esversion": 6 } Gruntfile.js jshint : { all: ["tests/API/**/*.js"], options: { undef: true, mocha: true, node: true, jshintrc: true, esversion: 6, globals: { require: true, module: true, console: true, esversion: 6, } }, ui: ["tests/UI/**/*.js"], options: { undef: true, mocha: true, node: true, jshintrc: true, esversion: 6, globals: {

cssmin not correctly handling @import

两盒软妹~` 提交于 2019-12-03 06:07:08
I am using cssmin on files containing @imports. cssmin is recursively importing local files correctly, but for imports that point to a URL the imports are left inline. This makes the resulting minified CSS invalid because @ rules must be at the beginning of the file. Does anyone know a good solution or workaround to this problem? Alex Carod I have exactly the same problem with cssmin and @import , and i found a solution with grunt concat : Create a concat grunt task that: Put @import url in the begining of mified css file and replaces references of @imports url for "". Execute task concat

Inline require() working in requirejs but not with optimized almond build

血红的双手。 提交于 2019-12-03 06:02:46
As the title says my inline require calls are working in a non-optimized requirejs run but not working when built with grunt and almondjs. Uncaught Error: undefined missing views/some/view The top of any file might be: define( ['jquery', 'app'], function($, App) { and later on based on business logic I want to be able to require another file require(['views/some/view'], function(SomeView){ console.log(SomeView); }); I tried the alternative syntax as well: var SomeView= require('views/some/view'); And this all works using an unbuilt requirejs version. But again it fails when I build it with

grunt watch task block the command line

余生颓废 提交于 2019-12-03 05:51:36
I'm new to grunt, still learning, so I came up to a very strange problem. When I run "watch" task, my command line becomes blocked, so basically I cant do anything on it. Bare in mind that the task is completed with success. This is my command line output: C:\server\css-test>grunt w Running "watch" task Waiting...OK >> File "compass-examples-master\02\sass\screen.scss" changed. Running "compass" (compass) task unchanged compass-examples-master/02/sass/ie.scss unchanged compass-examples-master/02/sass/print.scss overwrite compass-examples-master/02/stylesheets/new/sass/screen.css Running "watch

How do you make grunt.js not crash on warnings by default?

僤鯓⒐⒋嵵緔 提交于 2019-12-03 05:49:24
I'm using Grunt to compile CoffeeScript and Stylus with a watch task. I also have my editor (SublimeText) set to save files every time I page away from them (I hate losing work). Unfortunately, if Grunt hits a syntax error in any of the files it's compiling, it throws a warning and quits with Aborted due to warnings . I can stop it doing this by passing --force . Is there any way to make not aborting the default behavior (or control which tasks' warnings are important enough to quit Grunt? asgoth Register your own task, which will run the tasks you want. Then you have to pass the force option:

Gruntjs: How to make copy task to copy only changed files on watch

喜夏-厌秋 提交于 2019-12-03 05:49:05
问题 So on grunt-contrib-watch plugin info page, there is an example on how to make jshint run only for changed file. grunt.initConfig({ watch: { scripts: { files: ['lib/*.js'], tasks: ['jshint'], options: { nospawn: true, }, }, }, jshint: { all: ['lib/*.js'], }, }); grunt.event.on('watch', function(action, filepath) { grunt.config(['jshint', 'all'], filepath); }); I have not tested example it self. But took this and applied to my copy task, unsuccessfully. grunt-contrib-copy task set up to copy

NodeJS NPM Proxy error when installing grunt

喜夏-厌秋 提交于 2019-12-03 05:48:52
问题 When I'm trying to install grunt via npm , I'm getting a following error: C:\Program Files\nodejs\node_modules\npm>npm install -g grunt npm ERR! network connect ETIMEDOUT npm ERR! network This is most likely not a problem with npm itself npm ERR! network and is related to network connectivity. npm ERR! network In most cases you are behind a proxy or have bad network settings. npm ERR! network npm ERR! network If you are behind a proxy, please make sure that the npm ERR! network 'proxy' config

grunt server can't be connected <gruntjs>

China☆狼群 提交于 2019-12-03 05:43:38
module.exports = function(grunt) { // Project configuration. grunt.initConfig({ server: { port: 8888, base: '.' } }); }; C:\Program Files\nodejs\test\grunt> C:\Program Files\nodejs\test\grunt>grunt server Running "server" task Starting static web server on port 8888. Done, without errors. but can't connected by input [http://127.0.0.1:8888][1] in browsers ! jiong~ How about to fix this problem in windows or unix ? In grunt 0.4 combined with grunt-contrib-connect you can run a long running server by using the keepalive argument: grunt connect:target:keepalive or define it as an option in your