jjzjj

grunt-cli

全部标签

javascript - Grunt require 未能按预期创建多个模块

我的结构如下:应用程序脚本图书馆jquery.jsbootstrap.jsmoment.js应用程序.jsvendor.jscommon.jsapp.config.jsmain.js#需要配置请注意,vendor.js只是一个包含libs下所有文件的文件。例如//vendor.jsdefine(['jquery','bootstrap','moment'],function(){});只是列出依赖项:app.js依赖common.js和app.config.jscommon.js依赖vendor.jsapp.config.js依赖moment.js我想做的是运行gruntrequire

javascript - 脚本不从 .angular-cli.json 加载

我将新脚本添加到我的.angular-cli.json文件中,如下所示:"apps":[{"root":"src","outDir":"dist","assets":["assets","favicon.ico"],"index":"index.html","main":"main.ts","polyfills":"polyfills.ts","test":"test.ts","tsconfig":"tsconfig.app.json","testTsconfig":"tsconfig.spec.json","prefix":"app","styles":["../node_modul

javascript - 使用 grunt 进行 Angular 缩小会导致 'Failed to instantiate module' 错误

我知道设置Controller、服务、模型等来准备缩小。我有大约20个Controller、模型和服务作为单独的文件,我想将它们全部缩小并连接到一个JS文件中以用于生产。为了了解我是如何设置这些文件的,这里有一个例子:VforumJS.controller('MainController',['$scope','$location','$sce','MainModel','LogModel','MainDebug','timecode','Idle',function($scope,$location,$sce,MainModel,LogModel,MainDebug,timecode

javascript - Angular CLI 中的网络 worker

我一直在开发Angular应用程序,由于UI被阻塞,它在客户端有大量计算。我想在AngularCLI项目中使用Webworker在一个线程中运行UI并在backgroundthread中进行大量处理。有没有人有想法如何处理Angular中的繁重计算。如何在AngularCLI中使用WebWorkers一些引用资料AngularCLIgeneratedappwithWebWorkershttps://github.com/angular/angular-cli/issues/5885 最佳答案 您可以使用https://www.npm

javascript - Angular 5 : Lazy Loading is not working properly with ng build - -prod with Angular-CLI 1. 7.x

我在:Angular:5.2.6AngularCLI:1.7.x我的应用程序下有这个路由文件(我有一些延迟加载模块):consthomeRoutes:Routes=[{path:'home',component:HomeComponent,children:[....{path:'admin',loadChildren:'app/home/admin/admin.module#AdminModule',canActivate:[AuthGuardAdmin]},]},];@NgModule({imports:[CommonModule,RouterModule.forChild(hom

javascript - 如果使用 grunt-contrib-imagemin 优化图像,如何处理 Handlebars 模板中的图像

我用yeoman和generator-ember创建了一个ember应用程序。yoember我已将Handlebars模板放在app/templates中,将图像放在app/images中。如果我跑gruntserver一切看起来都很好。如果我跑gruntserver:dist一切看起来都很好,而不是我在Handlebars模板中处理的图像。似乎imagemin任务或其他任务将图像从images/map.jpg重命名为images/667de70e.map.jpg。我的index.html文件中的img标签已更正。但是我的Handlebars文件中的img标签,如templates/m

javascript - grunt 没有在 phantom 上运行 QUnit 测试

我有一个repository它与travis集成在一起。我有QUnit测试,我想从grunt/node服务器端和AMD(requirejs)运行。这是我的AMDinit.js的来源:(function(){require.config({baseUrl:"../src"});require(["../test/suites/basic",'../test/qunit-extend','qunit'],function(BasicTests){QUnit.config.autoload=false;QUnit.config.autostart=false;BasicTests.run()

javascript - Console.log 在使用 grunt 服务器的 Qunit 测试中不起作用

我正在创建在grunt服务器上运行的Qunit测试。在测试中,当我尝试使用“console.log”将一些输出记录到控制台时,它不会在控制台中打印任何内容。目前我只能使用OK来执行断言。请提供您的意见。 最佳答案 如果您在grunt中使用qunit任务,则需要使用--debug(即grunttest--debug)启动任务。然后,您将看到幻影日志以下列格式打印出您的控制台日志:[D]["phantomjs","console","MIXPANELPEOPLEREQUEST(QUEUED,PENDINGIDENTIFY):"]Seed

javascript - 如何将 grunt 任务的 feed 输出提供给另一个 grunt 任务?

我不确定grunt是否可以做到这一点。我有两个要运行的繁重任务。第一个任务是创建一个模拟帖子,第二个是运行penthouse任务来内联css。欢迎任何骇人听闻的方式。这是我在WordPress中创建博文时必须运行的exec任务。exec:{create_mock:{cmd:'cd~/MyProjects/project/vip-quickstart&&vagrantssh-c\'sh/srv/www/wp-content/themes/vip/the-theme/bin/mock-post.sh\'',callback:function(err,stdout,stderr){grunt

javascript - 缺少 grunt 必需的配置属性

设置一个新项目,该项目将包含多个我想从任务文件加载的grunt任务。在运行我的第一个任务“核心”(应该为网站构建核心CSS)时,我遇到了一个我似乎无法解决的错误。一直在谷歌搜索,但没有找到这个具体问题。相同错误消息的任何问题通常是由于OP的拼写错误或花括号放错地方造成的。不确定这里的情况,但也许其他人看到了我显然没有看到的东西。Gruntfile.jsmodule.exports=function(grunt){grunt.initConfig({pkg:require('./package.json')});grunt.loadTasks('grunt-tasks');};grunt