1

如何配置 weyland 以优化 css 文件并在输出中包含 js 的映射文件?

我目前的配置是:

exports.config = function(weyland) {
 weyland.build('main')
  .task.jshint({
     include: 'App/**/*.js',
     exclude: ['App/main-built.js'],
  })
  .task.uglifyjs({
     include: ['App/**/*.js', 'Scripts/durandal/**/*.js'],
     exclude: ['App/main-built.js'],
  })
  .task.rjs({
     include: ['Content/**/*.css', 'App/**/*.{js,html}', 'Scripts/durandal/**/*.js'],
     exclude: ['App/main-built.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',
        mainConfigFile: 'App/main.js', //not needed for require
        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,
        preserveLicenseComments: false,
        generateSourceMaps: true,
        //optimize : 'none',
        optimize: 'uglify2',
        optimizeCss: 'standard.keepLines',
        pragmas: {
           build: true
        },
        stubModules: ['text'],
        keepBuildDir: true,
        out: 'App/main-built.js'
     }
  });
}
4

0 回答 0