【问题标题】:Building main-build.js within Durandal Application在 Durandal 应用程序中构建 main-build.js
【发布时间】:2014-09-24 16:51:54
【问题描述】:

如何在 Durandal 应用程序中构建 main-build.js 文件?这是我指的文件:

exports.config = function(weyland) {
    weyland.build('main')
        .task.jshint({
            include:'App/**/*.js'
        })
        .task.uglifyjs({
            include:['App/**/*.js', 'Scripts/durandal/**/*.js']
        })
        .task.rjs({
            include:['App/**/*.{js,html}', 'Scripts/durandal/**/*.js'],
            loaderPluginExtensionMaps:{
                '.html':'text'
            },
            rjs:{
                name:'../Scripts/almond-custom', //to deploy with require.js, use the build's name here instead
                insertRequire:['main'], //not needed for require
                baseUrl : 'App',
                wrap:true, //not needed for require
                paths : {
                    'text': '../Scripts/text',
                    'durandal': '../Scripts/durandal',
                    'plugins': '../Scripts/durandal/plugins',
                    'transitions': '../Scripts/durandal/transitions',
                    'knockout': 'empty:',
                    'bootstrap': 'empty:',
                    'jquery': 'empty:'
                },
                inlineText: true,
                optimize : 'none',
                pragmas: {
                    build: true
                },
                stubModules : ['text'],
                keepBuildDir: true,
                out:'App/main-built.js'
            }
        });
}

我已经看过this页面(与Weyland一起建造),但还不够。

【问题讨论】:

    标签: javascript .net durandal single-page-application


    【解决方案1】:

    你需要安装node.js,然后全局安装weyland npm模块。要构建 main-build.js 文件,请导航到项目的根目录并运行 weyland 和命令提示符(假设您的 weyland-build.js 文件位于同一文件夹中)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-27
      • 1970-01-01
      相关资源
      最近更新 更多