gruntjs

Run PHPUnit tests on change

陌路散爱 提交于 2020-01-01 01:53:09
问题 I'd like to run my PHPUnit tests (or at least a subset of them) whenever a file changes on disk. Very similar to what you can do with "grunt watch". I have a project in which I have both JS and PHP, and am using Grunt. There I shell out to PHPUnit to have it run on top of my JS tests using grunt watch. While that works just fine, it seems like an awful lot of hassle to do this in a PHP only project. I'd need to introduce grunt, and add a dependency on node. Plus I have a lot of such PHP

What's the difference between concat and uglify and minify?

流过昼夜 提交于 2019-12-31 08:35:21
问题 What's the difference between concat, uglify, and minify tasks in grunt? I set up an uglify task for all of my site's javascript tasks, and it seemed to both minify and concatenate them. Grunt's site has a great description for how to configure each task, but it doesn't seem to explain what each task actually does. 回答1: Concatenation is just appending all of the static files into one large file . Minification is just removing unnecesary whitespace and redundant / optional tokens like curlys

Can't install any NPM package, error 4058

我怕爱的太早我们不能终老 提交于 2019-12-31 07:18:06
问题 I'm trying to install Grunt on my project. It used to work perfectly, but now for some reason, it does not. Every time i try to install Grunt, I got this error: npm ERR! path C:\irrelevent\path\project\node_modules\ansi-styles npm ERR! code ENOENT npm ERR! errno -4058 npm ERR! syscall rename npm ERR! enoent ENOENT: no such file or directory, rename 'C:\irrelevent\path\project\node_modules\ansi-styles' -> 'C:\irrelevent\path\project\.ansi-styles.DELETE' npm ERR! enoent This is related to npm

Dynamic Mapping and Concat with Grunt Uglify

蓝咒 提交于 2019-12-31 04:29:32
问题 I'm trying to use dynamic mapping AND concat Javascript files with Grunt Uglify. I have the following which is not working correctly. Here is my folder structure: javascript |- account |- custom.js |- bills |- billing-one.js |- billing-two.js |- test (output folder) Here is what I'm expecting: javascript |- account |- custom.js |- bills |- billing-one.js |- billing-two.js |- test |- billing-one.min.js (this file includes billing-one.js AND custom.js) |- billing-two.min.js (this file includes

grunt-contrib-htmlmin how to ignore template tags

天大地大妈咪最大 提交于 2019-12-30 18:50:36
问题 I'm using grunt-contrib-htmlmin to minify my html in a backbone/underscorejs project, however, when I run grunt-contrib-htmlmin on any underscorejs template that has <%= myvar %>, the task outputs a parse error. Is there a way grunt-contrib-htmlmin can ignore text inside <%= and %>? 回答1: Since you posted this issue, an new feature was introduced into html-minifier (which is used by grunt-contrib-htmlmin ) to ignore the interpolation tags that were causing the problem. For instance, the

grunt: possible to relocate “node_modules” for plugins?

六月ゝ 毕业季﹏ 提交于 2019-12-30 17:25:35
问题 If I install any grunt plugin, it is added to a folder named "node_modules" in the root of my project dir per default. My question: is it possible to move this whole folder (and therefore all plugins) to another location (but still within my project folder), let's say to "build/node_modules" ? Of course, I still want to be able to run grunt from anywhere in my project hierarchy after this change. 回答1: Nope, that's a feature of the Node.JS core files. In the case you don't know, Node.JS is the

Logging from grunt-contrib-jasmine

只谈情不闲聊 提交于 2019-12-30 16:25:10
问题 I'm using grunt-contrib-jasmine to run my javascript specs. How do I write debug output to the console when running specs i.e. how do I get console.log("something"); to show output in the console? I do find that I can get output by running: $ grunt jasmine --verbose But this prints a lot of information that I'm not interested in. How can I just see the output from console.log ? 回答1: Use console.info instead of console.log 回答2: Not a solution but a work around (sort of). Put in a expect(

ASP.NET MVC, AngularJS, Bower and deploying site folder structure

我与影子孤独终老i 提交于 2019-12-30 09:33:33
问题 I've read a lot of articles and questions about site folder structure (develop & deploy) and still have missunderstood about questions below. I marked my current folder structure: Orange- looks like lib or vendor folder, where i'd like to store independent components; Blue- folder contains my own, relative to current project (application) files; Green- ready to deploy folder, that contains minified & concated files, which used to be included in index.html. There are a few questions i'd like

Grunt doesn't give any output [Ubuntu]

坚强是说给别人听的谎言 提交于 2019-12-30 03:56:06
问题 My grunt doesn't give any output, and I just installed all the system, NPM and grunt-cli. When I type "grunt -v" nothing is returned. This is my package.json: { "name": "project", "version": "2.0.0", "devDependencies": { "grunt": "~0.4.1", "grunt-contrib-coffee": "~0.7.0", "grunt-contrib-compass": "~0.6.0", "grunt-contrib-uglify": "~0.2.2", "grunt-contrib-watch": "~0.5.3", "grunt-yui-compressor": "~0.3.0", "grunt-contrib-cssmin": "~0.7.0" } } And my Gruntfile.coffee is: module.exports =

AngularJS Error: Unknown provider: aProvider <- a

给你一囗甜甜゛ 提交于 2019-12-30 02:48:57
问题 OK I'm officially bald now, after having been streching my hair out with this infamous problem: The minfied AngularJS app just doesn't work, with this error thown out: Error: [$injector:unpr] Unknown provider: aProvider <- a http://errors.angularjs.org/1.2.6/$injector/unpr?p0=aProvider%20%3C-%20a at http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:11492 at http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:26946 at Object.c [as get] (http://localhost/my-app/dist/scripts