gruntjs

grunt build Aborted due to warning “Destination not written because minified HTML was empty” and “Parse Error:”

巧了我就是萌 提交于 2019-12-13 02:59:01
问题 I am using Yeoman (http://yeoman.io/) and I usually just run grunt build in order to minify and upload my AngularJS app to the server. However for some reason I am getting a >> Destination not written because minified HTML was empty. I haven't had this trouble before until now and I have not changed my Grunt file. It seems as though everything else is getting minifies just fine, even the other html files within the same /views directory. I read on this thread (grunt serve: concurrent:server

How to reload resources (HTML/CSS/JS) on version change

孤者浪人 提交于 2019-12-13 02:14:58
问题 I have a Web Application using AngularJS, oclazyload, ui-router, bootstrap and so on and I'll have updates coming out in the future, and I need to make sure that the browsers won't keep showing the cached resources, even when an updated version is available. For this I have configured my Gruntfile (using grunt-replace, grunt-prompt and grunt-bump) to append the version number to every URL in my index.html every time I create a new build. This works fine, but since I use ui-router and

Grunt concat all package.json dependencies

限于喜欢 提交于 2019-12-13 01:59:57
问题 This is the first time I use grunt & npm. My package.json contains this: "dependencies": { "angular": "latest", "bootstrap": "latest", "jquery": "latest" } Is there a way to tell grunt: "Look at all of my dependencies, load the right files, and create one JS file, and one CSS file for distribution"? *This is because I don't want to list all of the distribution files for every dependency. 回答1: yes you can use grunt modules like: concat, cssmin, and sass, for concat your files in just 1. I will

Running laravel app using Grunt fails to start session on local environment

大城市里の小女人 提交于 2019-12-13 01:43:51
问题 I am working on an angular-laravel app. I have an API kind of workflow. The angular app sits at the root of the project directory in the angular folder.This has the build tools and dependency management tools configured like bower and grunt. My routes.php has been configured to authenticate the user on login. Route::post('login','LoginController@auth'); Route::get('checkAuthentication','LoginController@isLoggedIn'); When I call both the routes,I always get the response as false. Tried

grunt-contrib-watch slow even with spawn = false

核能气质少年 提交于 2019-12-13 01:28:12
问题 I have set up the grunt-contrib-watch task to copy a list of files to a "dist" directory every time I save one of the files of the "src" directory. Unfortunately it takes 7 to 9 seconds to accomplish this task. I have heard about the "spawn" option for grunt-contrib-watch. Using load-grunt-tasks to load the config of each task from a separate JSON file, I changed my watch.json so that it looks like this : { "service": { "files": [ "src/*.php" ], "tasks": [ "copy:service" ], "options": {

jshint grunt exported options

♀尐吖头ヾ 提交于 2019-12-13 01:19:40
问题 Hi I'm trying to achieve the following. I'm using grunt for jshint validating. Somewhere in a file I have used: var logger = function () { // some ode } Because logger is never actually used jshint correctly shows me the following error. W098: 'logger' is defined but never used. I could set unused to false and it would work perfectly. But I actually want the option to take place in other files and warn me about unused variables. So the unused option is not gonna work for me. I also saw that I

How to implement properties preprocessing before execution like it is done in Grunt?

回眸只為那壹抹淺笑 提交于 2019-12-13 01:17:21
问题 Grunt has syntax which is used to set and update configuration properties before task execution. For example, config { dist: { dir: "dir1" }, clean: { dirs: [ '<dist.dir>' ] } } becomes in memory to ... config { dist: { dir: "dir1" }, clean: { dirs: [ "dir1" ] } } What npm module is responsible for this? Please, advice me how to implement it in a better way? Thank you! 回答1: Template Strings within Grunt come from the Lo-Dash package. References: Grunt.template LoDash Template 来源: https:/

grunt-karma not running the spec file when using shared config

≡放荡痞女 提交于 2019-12-13 01:11:58
问题 I created a basic project to try and get Gruntjs, Karma and Jasmine to play together. When I setup the karma.conf.js file with all of the neccesary files, everything works and the tests pass. When I try to split them up in Grunt though, I get problems. Gruntfile.js grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), karma: { options: { configFile: 'karma.conf.js' }, basicController: { files: ['/basicController/scBasicControllerCtrl.js', '/basicController/test/ControllersSpec.js'] },

Sails js application driving CPU usage to 100%

霸气de小男生 提交于 2019-12-12 22:08:00
问题 I'm building a an application using sails and every time I leave the server running for more than a few minutes my CPU jumps to a solid 100% usage. I'm including a big amount of less files in my assets and I believe my issue lies here. Are there any other reasons this may happen? 回答1: It could be the grunt-watch, when you have a lot of files it squeezes your cpu. Try disabling that and check if your cpu gets to a normal usage (6-30% depending on your cpu and overall usage). To do that go to

Using grunt to update base href

放肆的年华 提交于 2019-12-12 20:19:44
问题 During the build process of an angular app, I would like to update the <base href="/app-dev/"> tag to <base href="/app/"> inside index.html Is there a way to update this tag with usemin (for now, I use it to update the links to the js and css)? If not, what grunt task should I use to do that? 回答1: I used grunt-processhtml too like so in your say index.html file <!-- build:[href]:build /path/you/want/ --> <base href="/~myusername/myapp/public/" /> <!-- /build --> in your Gruntfile.js add a