gruntjs

How to configure sourceMaps for LESS using Grunt?

老子叫甜甜 提交于 2019-12-02 23:17:33
I'm using grunt 0.4.2 and grunt-contrib-less 0.9.0. I want my LESS to be compiled into CSS with support for source maps. My LESS files are in public/less , and the main one is called main.less . The compiling of public/less/main.less into public/css/main.css works, but source maps don't work. What is wrong with my Grunt config below? { less: { dev: { options: { compress: true, yuicompress: true, optimization: 2, sourceMap: true, sourceMapFilename: "public/css/main.css.source-map.json", //Write the source map to a separate file with the given filename. sourceMapBasepath: "public/less", //Sets

Node js as http server and host angularJS SPA

独自空忆成欢 提交于 2019-12-02 22:58:33
I have an application written on angularJS and built by grunt. Is there a way I can create a http server from node js and host it there. Please share any code snippet or document which would help. Thanks (simplest) if you don't have any server side logic, you can simply serve client side AngularJS/HTML/css via http-server module from npm. https://www.npmjs.com/package/http-server Just install it via $>npm install -g http-server and go to your client folder, type http-server and hit enter. If you have server side code written, (ExpressJS or restify web api) then use $>nodemon server.js If you

“No ESLint configuration found” error

天大地大妈咪最大 提交于 2019-12-02 22:01:10
Recently, we've upgraded to ESLint 3.0.0 and started to receive the following message running the grunt eslint task: > $ grunt eslint Running "eslint:files" (eslint) task Warning: No ESLint configuration found. Use --force to continue. Here is the grunt-eslint configuration: var lintTargets = [ "<%= app.src %>/**/*/!(*test|swfobject)+(.js)", "test/e2e/**/*/*.js", "!test/e2e/db/models/*.js" ]; module.exports.tasks = { eslint: { files: { options: { config: 'eslint.json', fix: true, rulesdir: ['eslint_rules'] }, src: lintTargets } } }; What should we do to fix the error? Arkadiusz Lendzian Try to

How do I fix my generator-angular project so that grunt test works?

我与影子孤独终老i 提交于 2019-12-02 21:56:12
I am working off of this tutorial: http://www.sitepoint.com/kickstart-your-angularjs-development-with-yeoman-grunt-and-bower/ as a means to understand what files are created using yo generator-angular. I have experience using AngularJS, but was looking for a way to get a best-practices directory set up; I am not sure how to set up dependencies and get karma running on my own, hence using the yeoman generator. However, straight out of the box, without editing anything else, when I run grunt test I get the following: running "clean:server" (clean) task Cleaning .tmp...OK Running "concurrent:test

Web App (Spring, Angular, Grunt, Maven, Tomcat) running both grunt and tomcat servers

 ̄綄美尐妖づ 提交于 2019-12-02 21:14:57
OK so I've been reading several of the other stack questions and trying to piece this together without much luck. Basically my approach is that I currently have one project with multiple sub-projects. I basically have the following: root |----backend |----|----src |----|----|----main |----|----|----|----java (individual java files not shown) |----|----|----|----resources |----|----|----|----|----META-INF |----|----|----|----|----|----applicationContext.xml |----|----|----|----webapp |----|----|----|----|----WEB-INF |----|----|----|----|----|----web_servicesConfig.xml |----|----|----|----|----|

Assets missing in Angular application built using grunt

安稳与你 提交于 2019-12-02 20:34:27
I have built an application using Yeoman and AngularJS (and all the stuff that goes along with it like Grunt and Bower). It all works perfectly when running locally using grunt serve . However, after running grunt and deploying the application, there are a couple of missing assets and I'm not sure what the best way to solve it is. Firstly, running Grunt seems to copy the images across to dist but it renames them without adjusting the references in the CSS. app/images/uparrow.png becomes dist/images/3f84644a.uparrow.png . Here is a line from the main.scss: .table.sortable th.sorted-asc {

List grunt.js tasks

时光总嘲笑我的痴心妄想 提交于 2019-12-02 19:52:56
I'm trying to work out how to print a list of all available grunt tasks. With rake it would be: $ rake -T What's the equivalent for grunt? e.g. $ grunt -T concat jasmine minify grunt --help lists available tasks. Workaround for the list in sh/bash in case you need to trigger something and can't modify the original code: grunt -h --no-color | sed -n '/^Available tasks/,/^$/ {s/^ *\([^ ]\+\) [^ ]\+.*$/\1/p}' 来源: https://stackoverflow.com/questions/15004624/list-grunt-js-tasks

Is it possible to use ES6 in a Chrome Extension?

北城余情 提交于 2019-12-02 18:59:40
I've just started building a Chrome Extension and was curious if I'd be able to use ES6 with it. In the following compatibility table , Chrome 41 shows that it currently has 41% compatibility. A couple key features like class are not included in that 41% and so I was curious if there were other options, such as transpiling. I've already used Babel , an ES6 transpiler, with Ember CLI and it has worked great. However, I find the build process a bit different when developing a chrome extension. For example, when testing an extension I'm developing, I load it into the browser via the "Load

how to minify js files in order via grunt-contrib-uglify?

元气小坏坏 提交于 2019-12-02 18:47:56
I have a directory like below: /folder/b.js /folder/jQuery.js /folder/a.js /folder/sub/c.js I want to minify all these js files in one js file in order : jQuery.js -> a.js -> b.js -> c.js Q: 1.How can I do it via grunt-contrib-uglify?(In fact, there are lots of files, it is impractical to specify all source filepaths individually) 2.btw, How can I get unminified files when debug and get minified single file when release and no need to change script tag in html(and how to write the script tag)? Good questions! 1) Uglify will reorder the functions in the destination file so that function

generator-angular: task “karma” not found when calling `grunt test`

我们两清 提交于 2019-12-02 18:47:05
I'm trying to setup a development environment with Yeoman for AngularJS, I installed Yeoman according to the instructions: sudo npm install -g yo bower grunt-cli generator-angular and I'm generating a new app with yo angular . After the app is generated, running karma start does start the karma server, but running grunt test result in Loading "grunt-karma.js" tasks...ERROR >> TypeError: object is not a function Warning: Task "karma" not found. Use --force to continue. Aborted due to warnings. how do I fix this ? EDIT: some files (generated fresh from Yeoman) Gruntfile.js: 'use strict'; var