gruntjs

ASP .NET 5 - grunt task to copy files from node modules to wwwroot

ぃ、小莉子 提交于 2019-12-10 17:26:51
问题 I have a simple ASP .NET 5 empty project - with npm and grunt installed. I've used npm to install a few client-side libraries, at present located in the node_modules directory directly under my ASP .NET project. I want to copy the relevant files (for example, jquery.min.js) from the node_modules folder into the wwwroot folder. It's unclear to me how to use grunt to do this - as each node module has it's own dependency tree, and there doesn't seem to be any consistency in the file structure

Is it possible to run a task after the watch task?

冷暖自知 提交于 2019-12-10 17:08:57
问题 I have a PHP-based project that won't run on grunt-php. Instead, I use grunt-exec to run my MAMP server for development. exec: { serverup: { command: '/Applications/MAMP/bin/start.sh' }, serverdown: { command: '/Applications/MAMP/bin/stop.sh' } } In my custom development task, I run the MAMP start script just before my watch task. Then, I'm trying to stop the MAMP server after I've exited the watch task. grunt.registerTask('default', ['jshint', 'concat', 'compass:dev', 'exec:serverup', 'watch

Grunt.js Watch Forever

徘徊边缘 提交于 2019-12-10 16:15:20
问题 Goal: I am trying to run a watch task in my Gruntfile.js as a daemon. Normally, I would execute this script like: grunt watch . Gruntfile.js: module.exports = function(grunt) { grunt.initConfig({ concat: { options: { separator: '' }, dist: { src: ['static/js/**/*.js'], dest: 'app.js' } }, watch: { files: ['<%= concat.dist.src %>'], tasks: ['concat'] } }); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-concat'); }; Question: How do I spawn grunt watch as a daemon?

grunt plugin to refresh eclipse java project

孤者浪人 提交于 2019-12-10 16:02:51
问题 Background: I have a java project that uses lesscss. I am using grunt with grunt-contrib-watch and grunt-contrib-less to compile my .less files to .css`. It all works nicely. The issue is that to get the eclipse tomcat server to start serving the updated .css files I need to refresh the project in eclipse. I was wandering if there is a way to force eclipse to refresh as part of the watch cycle in grunt ? or actually, is there a way to cause the currently open eclipse project ( given that I

Cannot get TeamCity Build Step to execute grunt-cli

泄露秘密 提交于 2019-12-10 16:00:06
问题 I'm trying to automate building of my project on a TeamCity server. I'm using grunt to define and configure my tasks. This works fine locally. Yet, I am having problems getting TeamCity (running on Windows Server 2008) to recognize grunt as a executable, the build will fail when grunt is called as it is not available. I do have grunt-cli installed on the server and can execute it when I login via ssh (The build script also succeeds when I trigger it that way). I'm running npm install before I

Obfuscating js files with grunt-obfuscator: Uncaught ReferenceError: require is not defined

不想你离开。 提交于 2019-12-10 15:59:24
问题 I was searching over the internet about how to ofuscate my javascript code and after use uglify that convert all my files minified but not obfuscated I decided to use grunt-obfuscator After make this configuration on my simple project: Gruntfile.js module.exports = function (grunt) { grunt.loadNpmTasks('grunt-obfuscator'); grunt.initConfig({ connect: { server: { options: { port: 9000, base: 'app/' } } }, watch: { project: { files: ['app/**/*.js', 'app/**/*.html', 'app/**/*.json', 'app/**/*

How i can use yeoman to work with Sass files?

谁都会走 提交于 2019-12-10 15:33:22
问题 I try to use yeoman to compile a styles.sass file founded in app/styles directory. In my index.html i write : <!-- build:css(.tmp/styles) styles/styles.css --> <link rel="stylesheet" href="styles/style.sass" /> <!-- endbuild --> When i launch grunt server Sass file is watched and compiled into .tmp/styles/ But in my dist/styles directory, nothing is written in my xxxxxxx.styles.css may i miss something? 回答1: Your Sass is compiled into .tmp/styles when running grunt server , since it's only

Using Babel to convert ES6 modules to ES5 AMD modules, not working as expected

二次信任 提交于 2019-12-10 15:21:51
问题 I hope someone can help. I'm using grunt-babel to convert my ES6 module code to ES5 AMD module code. Here's my ES6 code: multiply.js export default function (x,y) { return x * y; }; square.js import multiply from 'multiply'; export default function (x) { return multiply(x,x); }; app.js import square from 'square'; var myValue = square(2); console.log(myValue); As you can see, all I'm doing is creating a module 'multiply', importing that into another module 'square', and then finally using

Jasmine specs without specRunner.html - JS dependencies

空扰寡人 提交于 2019-12-10 15:18:39
问题 I have unit tests for an application where the javascript I wanted to test was dependent on other JS frameworks (underscore.js, backbone.js, jQuery...). So when setting up the specRunner.html I added these files as well: .... <head> <title>p13n.js Spec Runner</title> <link rel="shortcut icon" type="image/png" href="./jasmine-standalone-1.3.1/lib/jasmine-1.3.1/jasmine_favicon.png"> <link rel="stylesheet" type="text/css" href="./jasmine-standalone-1.3.1/lib/jasmine-1.3.1/jasmine.css"> <script

QUnit on Travis CI (PhantomJS timeout)

此生再无相见时 提交于 2019-12-10 14:59:23
问题 Whenever I try to QUnit-Test on Travis the build fails with a PhantomJS Timeout Error. See: https://travis-ci.org/misantronic/frameWreck/builds/38939015 from line 86. On my local system everything just works fine. Its actually loading all the sources (QUnits.js and my js-module) but as soon as the test() function is invoked, it fails. I found some topics about this issue, but these were because of the grunt version number (<0.4). Thats not the case. 来源: https://stackoverflow.com/questions