Tag: gruntjs

Grunt文件没有加载ngCordova和jquery

我有以下咕噜声的任务: // Generated on 2016-04-28 using generator-angular 0.15.1 //cwd – All src matches are relative to (but don’t include) this path. ‘use strict’; // # Globbing // for performance reasons we’re only matching one level down: // ‘test/spec/{,*/}*.js’ // use this if you want to recursively match all subfolders: // ‘test/spec/**/*.js’ module.exports = function (grunt) […]

Gruntfile.js中的Javascript变量?

我正在维护一个广泛使用Grunt的Web应用程序。 我必须缩小,在不同的时间将我的html,css,js文件复制到不同的位置。 为了方便起见,我在GruntFile.js中创建了一个简单的javascript变量,如下所示: var path=”C:/dist”; uglify: { options: { mangle: false }, my_target: { files: { path+’/js/jsFile.js’: [‘src/js/jquery-1.10.2.min.js’] } } } 当我构建这个时,我收到以下错误 >> SyntaxError: Unexpected token + 我不能在我的GruntFile.js中使用路径变量。 因为我有10个位置路径。

bower或grunt不断从index.html中删除jquery

这真让我抓狂。 到目前为止,Bower + Grunt(来自Yeoman)一直是挫败感和浪费时间的主要原因。 我想要的只是我的应用程序使用最新的(2.1.0)版本的jquery。 bower list正确报告了jquery 2.1.0作为官方更新。 我运行了bower install –save jquery来更新到最后一个版本。 bower list命令现在正确地将jquery#2.1.0作为依赖项报告,并且bower.json文件现在正确地列出了jquery,并将所需版本作为依赖项: { “name”: “xxx”, “version”: “0.0.0”, “dependencies”: { … “angular”: “1.2.13”, “jquery”: “~2.1.0”, “sizzle”: “1.10.16”, “bootstrap”: “~3.0.3”, … 但每次我运行grunt build或grunt serve , 列表都会从index.html删除,从而阻止整个应用程序运行。 #> grunt serve Running “serve” task Running “clean:server” (clean) task Cleaning .tmp…OK Running “bower-install:app” (bower-install) task jquery was not […]