gruntjs

Using a task runner without package.json

我是研究僧i 提交于 2020-01-07 06:44:28
问题 I'm evaluating task runners, Grunt and Gulp in particular, but there's one thing I dislike about both of them: the fact that they require a package.json file for your project. This is even though your project might not even be an npm project in the first place. In my case, I'm already using composer.json , which basically does the exact same thing. I ended up creating my package.json like this: { "name": "myproject", "version": "0.0.0", "devDependencies": { "grunt": "~0.4.5", "grunt-phpcs": "

Grunt task wiredp is not injecting ngcordova

你。 提交于 2020-01-07 06:36:52
问题 I have the following task writtenm in grunt , which removes ngCordova from index.html. How do I correct it? // Automatically inject Bower components into the app wiredep: { app: { src: ['<%= yeoman.app %>/index.html'], ignorePath: /\.\.\// }, test: { devDependencies: true, src: '<%= karma.unit.configFile %>', ignorePath: /\.\.\//, fileTypes:{ js: { block: /(([\s\t]*)\/{2}\s*?bower:\s*?(\S*))(\n|\r|.)*?(\/{2}\s*endbower)/gi, detect: { js: /'(.*\.js)'/gi }, replace: { js: '\'{{filePath}}\',' }

googleMaps appears in grey after refresh page

被刻印的时光 ゝ 提交于 2020-01-06 20:02:04
问题 i am a beginner in backbone and node js, i have added google maps to my template using these commands: script(src='/lib/google-maps/lib/Google.js') script(src='http://maps.googleapis.com/maps/api/js') script(src='http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js') div.googleMap( style='width: 250px; height: 250px;') and in my views : mod.mapTemplate = Marionette.ItemView.extend({ template: '#actors-map-template', initialize: function () { var mapProp = this.model.get('mapProp')

how to write advanced concat grunt script that find matches in seperate folders?

安稳与你 提交于 2020-01-06 14:52:29
问题 I need to write an advanced concat script using grunt. here is my boilerplate: ___js |____dist | |____vents | | |____commonEvents.js | | |____compare.js |____libs |____src | |____events | | |____carousel.common.js | | |____compare.js | | |____styles.common.js | |____handlers | | |____carousel.common.js | | |____compare.js | | |____style.common.js I want the concat task to look into "src/events" and "src/handlers" directory and find all the files ending with ".common.js" and concat them

Assets not loading in sails.js app

不打扰是莪最后的温柔 提交于 2020-01-06 14:48:32
问题 I moved from Arch Linux to Windows 7. I've installed nodejs, npm, sails, grunt. I created a new sails project with sails new <name> and started it with sails lift . My assets will be not compiled or injected by sails. .tmp/public does not exist, too. Maybe someone can help me out? 回答1: Check out this issue https://github.com/balderdashy/sails/issues/3013 Its probably that Grunt is defaulting to False, which means the grunt work flow is not building your assets or creating the public web

Using a node module within a Grunt Task fails

懵懂的女人 提交于 2020-01-06 13:11:33
问题 I'm trying to extract meta data from files read within a Grunt task. executing: node test.js on this file: var exif = require('exif2'); exif('fixtures/forest.png', function (err, o) { console.log(arguments); }); Produces the expected output However, executing the grunt process: grunt projectJSON module.exports = function (grunt) { var exif = require('exif2'); return grunt.registerMultiTask("projectJSON", "Creates project JSON file.", function () { exif('fixtures/forest.png', function (err, o)

Gruntjs concat & minify | Option to replace the code in destination file instead of appending

送分小仙女□ 提交于 2020-01-06 12:43:17
问题 Throughout the course of my project development I wish to combine JS and CSS files into global.js and global.css files and then minify them into global.min.js and global.min.css using gruntjs and use these minified files in my project. But everytime I run the commands it cancats/combines the files and adds the combined codes to the global files(Causing redundancy) instead of replacing those global files with the new combined codes. Is there any option for it or any other plugin to prevent

grunt watch no longer refreshes Chrome when using custom open connect config via https

半世苍凉 提交于 2020-01-06 10:52:50
问题 I just started up a new yo angular scaffolding and tried to configure grunt-contrib-connect to open a custom ssl domain name instead of localhost:9000. The custom domain is proxy_pass'd from https://api/ to http://localhost:9000 using nginx. grunt-contrib-connect and grunt-contrib-watch are updated to 0.7.1 and 0.6.1, respectively. The new setting works fine on initial launch ( grunt serve ), but now html/css/js/etc changes no longer trigger a browser reload. What else do I need to change?

How to install grunt outside of a project and run tasks from the project directory

不想你离开。 提交于 2020-01-06 08:27:07
问题 I'm watching this series of tutorials here and I can see that the grunt ( not the grunt-cli ) files are stored in the project root. I see that this is normally the case but wanted to put my files elsewhere. Is there a way to do this. Obviously I could run the init to create the package.json file in say /grunt and do the install there, but would it be relatively easy to tell it how to interface with my project /root/project . 回答1: Here is an potential example of your structure : main-folder ├─

Grunt my code is duplicated in concat.js

China☆狼群 提交于 2020-01-06 07:02:34
问题 Here is my grunt config file: module.exports = function (grunt) { grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-karma'); grunt.loadNpmTasks('grunt-contrib-sass'); grunt.initConfig({ uglify: { build: { src: 'app/concat.js', dest: 'app/concat.min.js' } }, concat: { options: { separator: ';', }, dist: { src: ['app/js/**/*.js', '!app/concat.js', dest: 'app/concat.js' } }, watch: { karma: