gruntjs

Is it possible to use ES6 in a Chrome Extension?

亡梦爱人 提交于 2019-12-03 05:39:30
问题 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.

“No ESLint configuration found” error

僤鯓⒐⒋嵵緔 提交于 2019-12-03 05:38:40
问题 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: [

How make bower build the package?

左心房为你撑大大i 提交于 2019-12-03 05:31:23
Is there a way to make bower run a package grunt after it was cloned from GitHub? I'm trying to use Bower but one of the packages I'm using is the Bootstrap extension, x-editable. The problem is that while other packages push a fully built version to github so when installed by Bower you have a built version x-editable expect you to run a grunt file to build the package. That is a common practice in other package managers like npm but I could find how to make Bower build it on install. Which means I need another mechanism to complete the installation of the package. Building on install is an

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

依然范特西╮ 提交于 2019-12-03 05:30:18
问题 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)

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

吃可爱长大的小学妹 提交于 2019-12-03 05:28:15
问题 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.

Programmatically set options for grunt task?

自古美人都是妖i 提交于 2019-12-03 05:14:12
I have a grunt task that looks at options with grunt.option('foo') . If I'm calling this task from grunt.task.run('my-task') , how can I change those arguments? I'm looking for something like: grunt.task.run('my-task', {foo: 'bar'}); which would be the equivalent of: $ grunt my-task --foo 'bar' Is this possible? ( This question is another issue I ran in to but is not exactly the same, because in this case I don't have access to the original task's Gruntfile.js.) If you can use task-based config options instead of grunt.option, this should work to give you more granular control: grunt.config

How to get Grunt-Contrib-Copy to copy files/directories relative to given source path

你说的曾经没有我的故事 提交于 2019-12-03 05:05:59
First time using this task and what I'm trying to achieve is the following: copy all directories/files from src/js/bower_components/* to build/assets/js/vendor/ I've tried using cwd property but it doesn't work at all when I use it.. I've set it to: src/js/bower_components/ From src . ├── Gruntfile └── src └── js └── bower_components └── jquery I currently get: . ├── Gruntfile └── build └── assets └── js └── vendor src └── js └── bower_components └── jquery What I'd like . ├── Gruntfile └── build └── assets └── js └── vendor └──jquery Here's my current grunt task copy: { main: { src: 'src/js

References to font (font-awesome) resources are not updated in yeoman/angular grunt build

我只是一个虾纸丫 提交于 2019-12-03 04:56:29
I'm aware of the SO threads about this (I've linked them below), but unfortunately I couldn't solve this with them, so please allow me this question :-) I've bootstrapped an AngularJS project with Yeoman and thus rely on a grunt.js build utilizing bower.js and SCSS. I want to use font-awesome and the glyphicons-halflings-regular from bootstrap-sass-official. When running "grunt serve" everything is fine, but when I want to create a fileset for distribution, the references to the font files are not updated as they should. The main.scss contains $icon-font-path: "../bower_components/bootstrap

How can I automate both E2E and unit tests with Yeoman & AngularJS?

流过昼夜 提交于 2019-12-03 04:45:55
问题 I'm using Yeoman and generator-angular to manage AngularJS apps, but I'm having trouble with automated testing. Running grunt test will run unit tests once. I can get E2E tests to run after unit tests by altering the karma config block in Gruntfile.js , adding e2e: karma: { //... e2e: { configFile: 'karma-e2e.conf.js', singleRun: true } }, Great: now when I type grunt test all tests are run. But they're only run one time, and there's a big overhead (starting compass, running the server,

Grunt compiling Jade files

六眼飞鱼酱① 提交于 2019-12-03 04:42:48
问题 I'm trying to configure my Gruntfile to compile all of my Jade files to individual HTML files. For example, if I have the following source folder: source └── templates ├── first.jade ├── second.jade └── third.jade Then I would expect grunt jade to output: build └── templates ├── first.html ├── second.html └── third.html Here's my Gruntfile using grunt-contrib-jade : module.exports = function(grunt) { grunt.initConfig({ jade: { compile: { options: { client: false, pretty: true }, files: [ {