gruntjs

Grunt + Karma test runner fails with “ReferenceError: module is not defined”

六月ゝ 毕业季﹏ 提交于 2020-02-04 05:11:05
问题 When running our Karma test through Grunt, the execution fails with the following error: [2013-12-30 10:14:22.690] [ERROR] config - Invalid config file! [ReferenceError: module is not defined] The Karma configuration in Gruntfile.js looks sane, I've copied it from another project, where it works just fine. Same for the karma.conf.js file, there's no difference to one of the other projects, where it works fine. I've had a look at this question, but it didn't help with fixing the issue: Testing

“Error: ETXTBSY” when installing the package with npm (gruntjs, gulp) at VirtualBox

戏子无情 提交于 2020-02-02 15:45:30
问题 I tried to install gruntjs package via npm, but the command npm install grunt --save-dev received an error: npm ERR! error rolling back Error: ETXTBSY, unlink '/home/me/www/public_html/test/try/node_modules/grunt/node_modules/lodash/lodash.js' npm ERR! error rolling back grunt@0.4.4 { [Error: ETXTBSY, unlink '/home/me/www/public_html/test/try/node_modules/grunt/node_modules/lodash/lodash.js'] npm ERR! error rolling back stack: 'Error: ETXTBSY, unlink \'/home/me/www/public_html/test/try/node

“Error: ETXTBSY” when installing the package with npm (gruntjs, gulp) at VirtualBox

浪尽此生 提交于 2020-02-02 15:44:06
问题 I tried to install gruntjs package via npm, but the command npm install grunt --save-dev received an error: npm ERR! error rolling back Error: ETXTBSY, unlink '/home/me/www/public_html/test/try/node_modules/grunt/node_modules/lodash/lodash.js' npm ERR! error rolling back grunt@0.4.4 { [Error: ETXTBSY, unlink '/home/me/www/public_html/test/try/node_modules/grunt/node_modules/lodash/lodash.js'] npm ERR! error rolling back stack: 'Error: ETXTBSY, unlink \'/home/me/www/public_html/test/try/node

“Error: ETXTBSY” when installing the package with npm (gruntjs, gulp) at VirtualBox

廉价感情. 提交于 2020-02-02 15:42:51
问题 I tried to install gruntjs package via npm, but the command npm install grunt --save-dev received an error: npm ERR! error rolling back Error: ETXTBSY, unlink '/home/me/www/public_html/test/try/node_modules/grunt/node_modules/lodash/lodash.js' npm ERR! error rolling back grunt@0.4.4 { [Error: ETXTBSY, unlink '/home/me/www/public_html/test/try/node_modules/grunt/node_modules/lodash/lodash.js'] npm ERR! error rolling back stack: 'Error: ETXTBSY, unlink \'/home/me/www/public_html/test/try/node

Grunt Livereload not showing HTML changes

僤鯓⒐⒋嵵緔 提交于 2020-01-24 23:59:05
问题 On my MEAN stack application, I'm trying make changes to the HTML view files and see those changes as I make them using Grunt's livereload. Grunt's livereload is working fine in the sense that it detects changes in my HTML files and refreshes the page during development. However, the actual changes are not reflecting on the page. If I push the files up the server, and reload the publicly available site, the changes are there. But I still can't see the changes while I'm developing. I'm 99%

How to use pm2 to run grunt serve

∥☆過路亽.° 提交于 2020-01-24 19:55:22
问题 my colleague passed me a project that you run grunt serve to start. Now I'm trying to use pm2 to start the project in the background forever so I can close my command line. However, I couldn't find a right way to do it. I've seen answers like cd /path/to/fullstack pm2 start grunt --name website -- serve but I don't quite understand and I have very little knowledge regarding grunt. All I know is that grunt serve runs multiple tasks at the same time for me. I know that if I know the base js

Asynchronous tasks in grunt.registerTask

房东的猫 提交于 2020-01-24 17:38:25
问题 I need to call two functions within grunt.registerTask , but the second function has to be called after the first function is done. So I was wondering if we can use callbacks or promises or other asynchronous mechanisms within grunt.registerTask . (More specifically, I need to launch karma in my first function call, and run karma in the second function call (to execute the initial unit tests). But in order to run karma, I need to launch it first. And that's what I'm missing.) 回答1: I had this:

CSS Modules and multiple layouts/themes?

[亡魂溺海] 提交于 2020-01-24 05:01:27
问题 In my application, I have multiple theme styles (you can think of them as different, separate CSS styles files). I would like to start using the CSS modules, but I don't know even how to import my first file. Lets assume the following (simple) directory structure: layouts/ themeA/ myComponent.css themeB/ myComponent.css themeC/ myComponent.css components/ myComponent.js Depending on the user settings, I would like to pick a different CSS. That's easy to do in the browser (or on the server).

CSS Modules and multiple layouts/themes?

前提是你 提交于 2020-01-24 05:01:16
问题 In my application, I have multiple theme styles (you can think of them as different, separate CSS styles files). I would like to start using the CSS modules, but I don't know even how to import my first file. Lets assume the following (simple) directory structure: layouts/ themeA/ myComponent.css themeB/ myComponent.css themeC/ myComponent.css components/ myComponent.js Depending on the user settings, I would like to pick a different CSS. That's easy to do in the browser (or on the server).

Dynamic file mapping with relative destination

强颜欢笑 提交于 2020-01-24 00:44:10
问题 This is a generic question about dynamic file mapping with Grunt.js , but for the example purpose, I'll be trying to build coffee files in a project with a dynamic structure : Here, I can have multiple (dynamic) target folders with a different depth. Finding coffee files remain easy, it will match **/coffee/*.coffee anytime. What I'm trying to achieve, is making the dest property relative to the matched coffee file : find **/coffee/*.coffee compile to ../js/*.js Instead of making it relative