gruntjs

Grunt Copy Flatten not working as expected

余生颓废 提交于 2019-12-04 01:35:15
I have a directory structure as follows: source/ libraries/ d3.js lodash.js //etc I have grunt-copy setup as follows: copy: { main: { files: [ { src: ["source/libraries/*.js"], dest: "build/", flatten: true } I expect it to flatten the output into build, so that I will have build/ d3.js //etc Instead, I get a reproduction of the original directory structure in build: build/ source/ libraries/ d3.js //etc What gives? Am I not using flatten properly? Well, if you're only using flatten because you want everything in source/libraries to go into build , I would suggest actually using the cwd

Angular grunt build (from yeoman) breaks my app

本小妞迷上赌 提交于 2019-12-04 01:09:42
问题 after running the build from the /dist folder I get: Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.1/$injector/modulerr?p0=ourname&p1=Error%3A…(http%3A%2F%2Flocalhost%3A8085%2Flib%2Fangular%2Fangular.min.js%3A32%3A462) nothing I do seems to solve this problem this is the grunt task flow - adapted 1 to 1 from yeoman angular-generator: module.exports = function(grunt){ require('load-grunt-tasks')(grunt); require('time-grunt')(grunt); grunt.initConfig({ //pkg: grunt.file

npm install causes errors like npm ERR! tar.unpack untar error on Debian

ぐ巨炮叔叔 提交于 2019-12-04 00:48:31
问题 Installing Grunt as in the Bootstrap documentation shown, I first installed grunt-cli globally with npm install -g grunt-cli and now I'm trying to execute npm install , but only getting errors: root@devvm:/var/www/axit/portfolio/public/bower_components/bootstrap# npm install npm ERR! tar.unpack untar error /root/.npm/wrappy/1.0.1/package.tgz npm ERR! tar.unpack untar error /root/.npm/wrappy/1.0.1/package.tgz npm ERR! tar.unpack untar error /root/.npm/brace-expansion/1.1.0/package.tgz npm ERR!

Error: Cannot find module 'time-grunt'

泄露秘密 提交于 2019-12-03 23:25:34
I try install time-grunt local and global, clear npm cache, update npm, but nothing helps. I get: Loading "Gruntfile.js" tasks...ERROR Error: Cannot find module 'time-grunt' Warning: Task "default" not found. Use --force to continue. My version od packages: node: '0.10.31', npm: '1.4.23' After run: npm install --save-dev time-grunt in package.json state: "devDependencies": { "grunt": "^0.4.5", ... "time-grunt": "^1.0.0" } This is part of my grunfile.js: module.exports = function( grunt ) { require('time-grunt')(grunt); grunt.initConfig({ // grunt tasks here }); // load tasks here // register

npm WARN deprecated lodash@2.4.2: lodash@<3.0.0 is no longer maintained

点点圈 提交于 2019-12-03 23:23:37
问题 I'm getting an error when using npm to install grunt-cli globally. It's related to lodash: npm WARN deprecated lodash@2.4.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^3.0.0. Here are the versions i'm using, and the list of global packages installed. node: v5.1.0 npm: v3.5.0 npm list -g: http://pastebin.com/NuJU3bY0 I've attempted to install the latest version of lodash (v3.10.1) globally, but I still got the error again after uninstalling my grunt-cli global package, and then

Compass error for command 'grunt server'

空扰寡人 提交于 2019-12-03 22:53:29
问题 I'm running a project for which I installed nodeJs, ruby, yeoman, compass, etc. Now Im running my project with command >grunt server or >grunt server --force but it is giving me following error for compass. E:\CRM_workspace\CRM_from_repo\ria>grunt server --force Running "server" task >> The `server` task has been deprecated. Use `grunt serve` to start a server. Running "serve" task Running "clean:server" (clean) task Cleaning .tmp...OK Running "concurrent:server" (concurrent) task Running

How to copy files without the full path with grunt.js?

穿精又带淫゛_ 提交于 2019-12-03 22:16:31
I want to copy the content of /pckg to /dist with grunt.js. Here is the structure: |-- folder1 | | | |-- folder2 | | | |-- pckg | | | |--myfolder | | | | | |-- myfiles | | | |--myfiles | | |-- dist | |--myfolder | | | |-- myfiles | |--myfiles Here's my Gruntfile.js module.exports = function (grunt) { // Package configuration grunt.initConfig({ // Metadata pkg: grunt.file.readJSON('package.json'), //Copy files copy: { main: { expand: true, src: 'folder1/folder2/pckg/**', dest: 'dest/' } } }); // Load the plugin that provides the "copy" task. grunt.loadNpmTasks('grunt-contrib-copy'); // Default

How to compile multiple scss files using grunt-sass

拜拜、爱过 提交于 2019-12-03 22:13:38
I am trying to compile multiple .scss files into a single CSS file. This actually works but only grabs the first file... sass: { // Task dist: { files: { 'css/test.css':'sass/*.scss' } } } We don't have ruby installed so grunt-contrib-sass is not an option. I do the same thing in Stylus like this... stylus: { compile : { files : { 'css/g.css' : 'stylus/*.styl' } } } What about running grunt-contrib-concat first? concat: { dist: { src: [ 'sass/*.scss', ], dest: 'sass/build.scss', } }, sass: { // Task dist: { files: { 'css/test.css':'sass/build.scss' } } } and then task: grunt.registerTask('sass

how to have grunt task render mustache partials to static HTML

那年仲夏 提交于 2019-12-03 20:35:17
Background I've been using grunt.js with a hogan.js task to build the static HTML for our internal docs. I'm learning JavaScript as I go, but I've gotten the task to work well enough for layouts and pages, but it would really help our workflow to have the hogan task render mustache partials to HTML, as in the example in this gist: https://gist.github.com/4132781 Current Setup and what I want to accomplish All of our mustache partials are in a folder called "partials". Ideally when the grunt build is run, the hogan task will grab any partials from the partials folder and insert them into the

How to run a Grunt task after my Yeoman generator finishes installing?

放肆的年华 提交于 2019-12-03 18:34:13
问题 I'm building a custom Yeoman generator that installs a lot of pre-processed language compilers like CoffeeScript, LESS and Jade. In the Gruntfile that my generator creates I have a build task which compiles everything. However, until that build task is run at least once, the compiled HTML, CSS and Javascript files don't exist, which can be confusing if I try to run the grunt watch/connect server after freshly scaffolding. What is the best way to have my generator run that Grunt build step at