gruntjs

Grunt jade error

丶灬走出姿态 提交于 2021-01-27 05:37:08
问题 Whenever I run grunt jade I get an error: Warning: pattern.indexOf is not a function Use --force to continue. Now here is my jade task: jade: { options: { pretty: true }, all: { files: { expand:true, cwd: 'src/static/jade', ext: "html", src: ['src/static/jade/**/*.jade', '!src/static/jade/_includes'], dest: 'build/' } } } So basically I am trying to take the jade files in src/static/jade (including subdirs, except _include ) and put them in build , keeping the directory structure. I have

Install devDependencies on Heroku

落花浮王杯 提交于 2020-11-25 06:08:50
问题 I would like to have Heroku build my app after I push it so that I don't have to push the build folder up every time I make a change. However heroku only installs the dependencies from the package.json and grunt (my build tool) and all of its components are in devDependencies. I would like to keep them there where they belong. What's the workaround here? 回答1: Heroku by default installs only the production dependencies, ignoring the development dependencies under devDependencies . Setting the

Install devDependencies on Heroku

放肆的年华 提交于 2020-11-25 06:08:42
问题 I would like to have Heroku build my app after I push it so that I don't have to push the build folder up every time I make a change. However heroku only installs the dependencies from the package.json and grunt (my build tool) and all of its components are in devDependencies. I would like to keep them there where they belong. What's the workaround here? 回答1: Heroku by default installs only the production dependencies, ignoring the development dependencies under devDependencies . Setting the

Grunt: Access Sequence/List Data from External YAML File

亡梦爱人 提交于 2020-06-28 05:19:13
问题 I am trying to access values from an external YAML file in my Gruntfile using: external = grunt.file.readYAML('_config.yml'); The _config.yml file has the following example data: computer: parts: - name: brand1 type: cpu - name: brand2 type: gpu - name: brand3 type: hd I've been trying to access the multi-level YAML data using <%= %> grunt templating to get the different name and type values. module.exports = { concat: { src: ['htdocs/<%= external.computer.parts['type'] %>/<%= external

How can I optimize all my images?

牧云@^-^@ 提交于 2020-04-30 07:34:30
问题 Diagnose I recently came across : PageSpeed Insights, it basically test your page speed, spit out a score, and display what cause your page to slow-down. I enter my url and here is my : result. Issues I clearly don't have a lot score, but I'm working on improving them. I got a lot of image optimization problems. I've tried 2 things. __ 1.Use ImageOptim Software I've tried using ImageOptim Mac Software to optimize all my images in my img/ folder. 2.Use grunt imagemin plug-in On top of that I ,

How can I optimize all my images?

寵の児 提交于 2020-04-30 07:32:05
问题 Diagnose I recently came across : PageSpeed Insights, it basically test your page speed, spit out a score, and display what cause your page to slow-down. I enter my url and here is my : result. Issues I clearly don't have a lot score, but I'm working on improving them. I got a lot of image optimization problems. I've tried 2 things. __ 1.Use ImageOptim Software I've tried using ImageOptim Mac Software to optimize all my images in my img/ folder. 2.Use grunt imagemin plug-in On top of that I ,

Dynamic Grunt involving n subdirectories

喜欢而已 提交于 2020-03-26 04:51:45
问题 I have a folder layout such that: / -- css/ -- js/ -- apps/ -- -- myFirstApp/ -- -- mySecondApp/ -- -- ... Each of these are git submodules, and have a corresponding Gruntfile, package.json, etc. What I want to do is the same sequence of commands, but differ depending on the respective package.json. My command list is this: npm install grunt dist copy app/css/[fileName].css (from package.json) to css/ copy app/js/[fileName].js to js/ copy app/js/[fileName].html to / Is there a plugin or

Grunt cmd with spaces in the path

泪湿孤枕 提交于 2020-02-25 08:36:05
问题 When using grunt.util.spawn on win32 with spaces in the path of the cmd argument it is calling it without escaping the space. For instance my path contains "C:\Users\Beech Horn" so the error message I receive is 'C:\Users\Beech' is not a recognized as an internal or external command, operable program or batch file However grunt.file.exists shows the file is there. Also if I wrap the cmd argument with '"' + cmd '"' , grunt.file.exists can find the file however I get Fatal error: spawn ENOENT

Show image immediately after upload in sailsjs

自古美人都是妖i 提交于 2020-02-20 10:54:56
问题 I have form with upload field. After searching for a while, I just put uploaded files to folder ./assets/posts and it worked correctly. In my app, when submit done, it should be reload current url and show new uploaded image. But it didn't. My sails app use linker to manage assets. So after 3 or 4 times I try to reload the page, image is showed. How to show image immediately when I submit done? Thanks a lot! 回答1: Sails uses assets folder to store mainly the assets that are supposed to be

Show image immediately after upload in sailsjs

廉价感情. 提交于 2020-02-20 10:52:09
问题 I have form with upload field. After searching for a while, I just put uploaded files to folder ./assets/posts and it worked correctly. In my app, when submit done, it should be reload current url and show new uploaded image. But it didn't. My sails app use linker to manage assets. So after 3 or 4 times I try to reload the page, image is showed. How to show image immediately when I submit done? Thanks a lot! 回答1: Sails uses assets folder to store mainly the assets that are supposed to be