2015-03-13 19 views
2

我最近下載了VS15 CTP-6以獲得如何開發下一代VS項目的感覺,但無法找出開發流程,我應該遵循這種分離代碼和wwwroot。ASP.Net vNext結構和開發流程

我的理解是這是(角項目):

  1. 發展的意見,CSS和JS。
  2. 使用grunt任務uglify並將css和js複製到wwwroot文件夾。
  3. 將wwwroot作爲本地IIS站點瀏覽以查看更改。
  4. 當wwwroot準備好生產時,請複製它的內容。

但是,如果我在步驟3中發現問題,我怎麼才能找到它的起源,因爲js和css被縮小了?

當然,我錯了,所以我應該創建wwwroot的另一個副本的發展,沒有縮小?

回答

1

您應該使用咕嚕任務來醜化/當你準備在生產
去,並使用其他咕嚕任務,當你在開發中是複製你的代碼運行如下代碼
或者你可以使用與醜化2目標:1到uglify和1美化:

module.exports = function (grunt) { 
    grunt.initConfig({ 
     bower: { 
      install: { 
       options: { 
        targetDir: "wwwroot/lib", 
        layout: "byComponent", 
        cleanTargetDir: false 
       } 
      } 
     }, 
     uglify: { 
      ugli_target: { 
       files: { 
        "wwwroot/scripts/chat.js": ["Scripts/chat.js"] 
       } 
      }, 
      beauty_target: { 
       options: { 
        beautify: { 
         beautify: true 
        }, 
        mangle: false, 
        sourceMap: true 
       }, 
       files: { 
        "wwwroot/scripts/chat.js": ["Scripts/chat.js"] 
      } 
     } 
     } 
    }); 

    // This command registers the default task which will install bower packages into wwwroot/lib 
    grunt.registerTask("default", ["bower:install"]); 

    // The following line loads the grunt plugins. 
    // This line needs to be at the end of this this file. 
    grunt.loadNpmTasks("grunt-contrib-uglify"); 
    grunt.loadNpmTasks("grunt-bower-task"); 
}; 
+0

美化工作就像一個魅力。謝謝! – Droritos 2015-03-14 15:28:31