मैं जिस तरह से Yeoman कोणीय जनरेटर में संपत्ति संभालती है की एक बहुत बड़ा प्रशंसक हूँ। यह स्वचालित रूप से आपके index.html में बोवर पैकेज को शामिल करने के लिए वायर्डेप का उपयोग करता है। Usemin का उपयोग उन फ़ाइलों को समूहित करने के लिए किया जाता है जिन्हें आप बंडलों में चाहते हैं और Filerev संपत्ति स्थानों को अपडेट करता है और कैश ब्रेकर जोड़ता है। मेरे पास कुछ गंट सेटिंग्स का नमूना है।
wiredep: {
app: {
src: ['<%= yeoman.app %>/index.html'],
exclude: ['bootstrap.css'],
fileTypes: {
html: {
replace: {
js: '<script src="/{{filePath}}"></script>',
css: '<link rel="stylesheet" href="/{{filePath}}" />'
}
}
},
ignorePath: /\.\.\//
}
},
// Renames files for browser caching purposes
filerev: {
dist: {
src: [
'<%= yeoman.dist %>/scripts/{,*/}*.js',
'<%= yeoman.dist %>/styles/{,*/}*.css',
'<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
'<%= yeoman.dist %>/styles/fonts/*'
]
}
},
// Reads HTML for usemin blocks to enable smart builds that automatically
// concat, minify and revision files. Creates configurations in memory so
// additional tasks can operate on them
useminPrepare: {
html: '<%= yeoman.app %>/index.html',
options: {
dest: '<%= yeoman.dist %>',
flow: {
html: {
steps: {
js: ['concat', 'uglifyjs'],
css: ['cssmin']
},
post: {}
}
}
}
},
// Performs rewrites based on filerev and the useminPrepare configuration
usemin: {
html: ['<%= yeoman.dist %>/**/*.html'],
css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
options: {
assetsDirs: ['<%= yeoman.dist %>', '<%= yeoman.dist %>/images'],
patterns: {
js: [
[/templateUrl:"(templates[/A-Za-z0-9]*\.html)"/]
]
}
}
},
प्रासंगिक NPM संकुल grunt-wiredep, grunt-filerev, और grunt-usemin
हैं आप एक घुरघुराना निर्माण प्रक्रिया MSBuild बाद भी आपके बिन फ़ोल्डर में फ़ाइलें लेता है और उन पर इन घुरघुराना कार्य चलाता जोड़ने की आवश्यकता होगी।
आप के बारे में बनाता है चिंता करने की ज़रूरत है? तैनाती के बारे में क्या? क्या आप वेब डिप्लॉयमेंट का उपयोग करते हैं या आप संकलित फाइलों की प्रतिलिपि बनाते हैं? – Slick86
अच्छा सवाल। निर्माण के लिए मैं TeamCity का उपयोग करता हूं और फिर OctopusDeploy के साथ तैनाती करता हूं। यह सब स्वचालित है और वर्तमान में काफी अच्छी तरह से काम करता है। –
एमवीसी बंडलिंग की एक नई विधि लागू नहीं की गई है लेकिन योजना बनाई गई है: https://github.com/aspnet/Mvc/issues/2024 –