gruntjs

grunt-contrib-sass: incompatible character encodings: UTF-8 and CP850

◇◆丶佛笑我妖孽 提交于 2019-12-09 01:37:51
问题 While trying to use grunt to convert my sass files into normal css files i get the warning: Warning: Encoding::CompabilityError: incompatible character encodings: UTF-8 and CP850. However when I run sass calling the file(s) everything works as it should even though no encoding is specified by me. My Gruntfile.js looks like this: [...] sass: { main: { files: { 'css/theme/default.css': 'css/theme/source/default.scss', 'css/theme/beige.css': 'css/theme/source/beige.scss', 'css/theme/night.css':

Grunt 0.4 less task : How to not concatenate destination files

大兔子大兔子 提交于 2019-12-08 23:34:41
问题 I want to generate .css partial files from the corresponding .less files I use the latest versions available from npm, grunt@0.4.0, grunt-contrib-less@0.5.0 Prior to Grunt version 0.4 I could simply specify the pattern: htdocs/less/*.less as source htdocs/css/*.css as destination and all the files from the folder htdocs/less would be generated into the folder htdocs/css Since v0.4 the destination pattern does no longer work, all files from the folder htdocs/less are concatenated into one file

How to solve dependency issues with built AngularJS app?

风流意气都作罢 提交于 2019-12-08 18:06:14
问题 I'm new to AngularJS and am creating an app which will be built using Grunt. When I build and run my app, I'm noticing some issues related to dependency load order: Uncaught Error: [$injector:nomod] Module 'mycompany.admin.forms' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.2.13/$injector/nomod?p0=mycompany.admin.forms In the built app file,

Uglify with SourceMaps while using grunt usemin and rev

我怕爱的太早我们不能终老 提交于 2019-12-08 17:36:21
问题 I want to log javascript errors to server but the stacktrace is not useful with minified JS code. So I was thinking of using either Getsentry or Rollbar which shows proper stack trace with the help of sourcemaps . But I'm struggling to create sourcemap in first place. I'm getting this error "Destination (_build/js/app.js) not written because src files were empty." Once it creates source map properly, there will be another problem i.e. rev will rename the file. I also need to leave the

grunt jasmine-node tests are running twice

↘锁芯ラ 提交于 2019-12-08 16:55:40
问题 I set up grunt to run node.js jasmine tests. For some reason, with this config, the results always show double the tests. Here is my config: I'm using jasmine-node which plugs into grunt. /spec/some-spec.js : var myModule = require('../src/myModule.js'); describe('test', function(){ it('works', function(done){ setTimeout(function(){ expect(1).toBe(1); done(); }, 100); }); }); Gruntfile.js : module.exports = function(grunt) { grunt.initConfig({ jasmine_node: { options: { forceExit: true }, all

How to use SASS for components style in Angular 2?

女生的网名这么多〃 提交于 2019-12-08 16:54:01
问题 In Angular 2 when we define a component we can specify a styleUrls property to the decorator which points to a set of stylesheets to be applied to the component: @Component({ selector: 'the-app' templateUrl: 'templateFile.html', styleUrls: ['componentStyles.css', 'moreComponentStyles.css'] }) export class TheAppComponent {} Now, what if I want to write these styles with SASS? I know I would need to use Gulp or Grunt to transpile the SCSS stylesheets to plain CSS. But this makes me confused on

Angular2.0 in subdirectory, SystemJS cant import angular components

℡╲_俬逩灬. 提交于 2019-12-08 16:22:47
问题 I am getting started with Angular2.0. I have been following the 5 Min Quickstart and everything works fine although I am using grunt to compile my Typescript and some Sass etc. I just have one problem I cant solve by myself. I want to move all the public files (generated Javascript and production node modules into a subdirectory. I need to have that, because I run different applications unter the same domian. The frontend depends on the user type that logged in. (backend is written with

How can I perform an asynchronous operation before grunt.initConfig()?

浪子不回头ぞ 提交于 2019-12-08 16:13:01
问题 Now I have my Gruntfile setup to perform some automatic detection magic like parsing sourcefiles to parse some PHP sources in roder to dynamically figure out filenames and paths I need to know before running grunt.initConfig() . Unfortunately grunt.initConfig() doesn't seem to be meant to be run asynchronously, so I see no way to have my asynchronous code executed before I can call it. Is there a trick to accomplish this or do I have to rewrite my detection routines synchronously? Is there

Models not loading properly when trying to use Mocha testing

蓝咒 提交于 2019-12-08 15:50:35
问题 I'm trying to use mocha to test my express app. My folder structure is: myapp |-app |--models |-test |--mocha-blanket.js |--mocha |--karma |-server.js server.js is my express server. I had that before in options.require , but the documentation said to use a blanket.js . My mocha-blanket.js is: var path = require('path'); var srcDir = path.join(__dirname, '..', 'app'); require('blanket')({ // Only files that match the pattern will be instrumented pattern: srcDir }); My Gruntfile has: mochaTest

Installing jQuery-Mobile via bower

百般思念 提交于 2019-12-08 14:57:58
问题 In my project I would like to use jquery-mobile via bower. Before I can use it I have to run npm install and grunt subsequently inside of bower_components/jquery-mobile before I can use the minified .js and .css files. This is quite tedious and if I had to do this for every library that I use, I guess I would fallback to just downlading the files and add them to my project. So is there a more elegant way to get to those "final" files via bower dependency? My bower.json "dependencies": { ...