本文介绍了多设备混合应用:如何在发布和分发构建过程中结合,缩小和模糊?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一个好的方法来组合Javascript / Css文件,并使用多设备混合应用程序项目类型为Visual Studio发布和分发构建做小型化和模糊处理?我目前使用Grunt执行这些任务,但我对一个完整的Visual Studio驱动的过程感兴趣。

Is there a good way to combine Javascript/Css files and do minification and obfuscation for the release and distribution builds using the multi-device hybrid apps project type for Visual Studio? I currently use Grunt for executing these tasks, but I'm interested in a complete Visual Studio driven process.

推荐答案

Grunt / gulp和。

You can use Grunt/gulp with the TaskRunner Explorer extension for Visual Studio.

为了确保您的应用程序在构建node_modules目录时排除它,您必须编辑c:\Users_user_name_\\中的util.js文件\\AppData\Roaming\\\
pm\\\
ode_modules\vs-mda\lib\ like this:

To make sure your application will exclude the node_modules directory when you'll build it, you'll have to edit the util.js file in c:\Users_user_name_\AppData\Roaming\npm\node_modules\vs-mda\lib\ like this :

util.getDefaultFileNameEndingExclusions = function () {
    return [settings.projectSourceDir + '/bin',
            settings.projectSourceDir + '/bld',
            settings.projectSourceDir + '/node_modules',//add this line
            settings.projectSourceDir + '/merges',
            settings.projectSourceDir + '/plugins',
            settings.projectSourceDir + '/res',
            settings.projectSourceDir + '/test',
            settings.projectSourceDir + '/tests',
            '.jsproj', '.jsproj.user'];
}

此扩展程序在visual studio中提供grunt / gulp任务控制面板:

This extension provides a grunt/gulp task control panel in visual studio :

安装npm模块将是你必须从Visual Studio中做的唯一的

Install your npm modules will be the only thing you will have to do out of Visual Studio

希望有帮助

这篇关于多设备混合应用:如何在发布和分发构建过程中结合,缩小和模糊?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 22:09