gruntjs

Grunt Typescript can't find angular core

点点圈 提交于 2019-12-09 12:14:43
问题 Question Why cant my Grunt Typescript compiler find the angular core? I guess it has something to do with the paths so the compiler cant find the libs in the node_modules directory. Error typescript/add.component.ts(1,25): error TS2307: Cannot find module 'angular2/core'. Setup Gruntfile.js Task typescript: { all: { src: ['typescript/**/*.ts'], dest: 'javascript/frontend', options: { target: "es5", module: "system", moduleResolution: "node", emitDecoratorMetadata: true, experimentalDecorators

usemin revved filenames and requirejs dependencies

可紊 提交于 2019-12-09 11:47:49
问题 I'm running into the following problem with requirejs and usemin: I want to setup a multipage application, where I dynamically load modules that only contain page specific functionality (e.g. about -> about.js, home -> home.js). I could go ahead and pack everything in a single file, but that just leads to a bigger file size and overhead on functionality that isn't necessary on each site! (e.g. why would I need to load a carousel plugin on a page that doesn't have a carousel!) I checked out

Grunt module to inject HTML templates

此生再无相见时 提交于 2019-12-09 11:23:42
问题 Recently started using Grunt as a build tool for a web app I'm hobbyist developing. I have a series of HTML files (to be used as templates), in a single folder, that I'd like injected at a particular point in the main HTML file. Ideally, I could also wrap each file in a tag, but having to manually include this in the template files themselves is acceptable. Is there an existing Grunt module to perform this? EDIT: I may have worded my problem poorly before. Essentially, I have a single HTML

how to install underscore.js in my angular application?

半城伤御伤魂 提交于 2019-12-09 10:30:53
问题 I used yo-angular to generate my angularjs template with bootstrap/grunt/bower. I also want to use underscore in the app: npm install underscore --save-dev In the MainCtrl I am calling underscore.js just to see whether it works: angular.module('yomanApp') .controller('MainCtrl', function ($scope) { $scope.awesomeThings = [ 'HTML5 Boilerplate', 'AngularJS', 'AngularJS' ]; _.each([1,2,3],console.log); }); When I run the application with Chrome I get this errmsg in the console: ReferenceError: _

How to get grunt.js to start an express app for testing

瘦欲@ 提交于 2019-12-09 10:17:07
问题 My current situation is that I use grunt to make a production version of my express app (minimize and merge all the js/css, copy all the files in place) and then I have to run a script which sets an environment variables (my app only serves the test harness when running in TEST mode), creates an empty Mongo test database and then calls npm start on the application directory, and then I manually have to run the tests from either Chrome or Phantom, what I want to do is have grunt set the

Grunt - read json object from file

家住魔仙堡 提交于 2019-12-09 08:41:45
问题 I want to use grunt-hash plugin for renaming my js files. This plugin create a new file containing map of renamed files: hash: { options: { mapping: 'examples/assets.json', //mapping file so your server can serve the right files Now I need to fix links to this files by replacing all usages (rename 'index.js' to 'index-{hash}.js') so I want to use grunt-text-replace plugin. According to documentation I need to cofigure replacements: replace: { example: { replacements: [{ from: 'Red', // string

Access Grunt config data within initConfig()

孤者浪人 提交于 2019-12-09 05:19:38
问题 How can I access the Grunt config property site to read the project.json file at the path specified by the config property value? grunt.registerTask('build', function(target) { grunt.config('site', target); grunt.task.run('foo:dist', 'bar:dist'); }); grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), site: grunt.file.readJSON('./sites/' + grunt.config('site') + '/project.json') }); grunt-cli: grunt build:sitename >> Error: Unable to read "./sites/undefined/project.json" Using an

How do you make grunt.js not crash on warnings by default?

ぃ、小莉子 提交于 2019-12-09 05:08:55
问题 I'm using Grunt to compile CoffeeScript and Stylus with a watch task. I also have my editor (SublimeText) set to save files every time I page away from them (I hate losing work). Unfortunately, if Grunt hits a syntax error in any of the files it's compiling, it throws a warning and quits with Aborted due to warnings . I can stop it doing this by passing --force . Is there any way to make not aborting the default behavior (or control which tasks' warnings are important enough to quit Grunt?

grunt watch & connect

試著忘記壹切 提交于 2019-12-09 04:34:21
问题 I am kinda new to grunt and want to use it with Jekyll and some LESS-compiling. My problem now is, I already have fully functioning LESS-comipiling with live reload and watch task and can build my jekyll site through grunt, but how do I run something like the jekyll serve or grunt-connect and grunt watch simultaneously? I want a grunt task that provides the watching of my LESS-files etc, builds the jekyll site and then runs a small web server with grunt-connect or whatever. My Gruntfile.js so

Cannot use grunt on simple Yeoman angular

北城余情 提交于 2019-12-09 04:22:12
问题 Trying to just startup a simple angular app via Yeoman, using steps in this guide http://www.sitepoint.com/kickstart-your-angularjs-development-with-yeoman-grunt-and-bower/ and get this error when trying to run grunt or grunt server : Loading "Gruntfile.js" tasks...ERROR Error: Cannot find module 'load-grunt-tasks' Warning: Task "default" not found. Use --force to continue. Here are my versions: yo --version && grunt --version && bower --version 1.1.2< grunt-cli v0.1.13 grunt v0.4.4 1.3.1 See