[英]How do I setup a ASP.net Core MVC web application to IIS when publishing it creates .dll, .pdb, and .json files
[英]ASP.NET MVC how to produce the physical files of each bundle when publishing
是否有可能實際上獲取框架在運行時生成的捆綁包,但在發布應用程序時作為物理文件生成呢?
例如,如果我有3個文件包: a.js
, b.js
和c.js
(和/或a.min.js
, b.min.js
, c.min.js
),然后發布網站上,我只想獲取mybundle.js
(其內容按a,b和c最小化版本的順序組合)。
這可能嗎?
如果要在構建時合並文件,則應考慮使用任務啟動器(如gulp) 。
以下是鏈接問題中已接受答案的示例:
var gulp = require('gulp'),
gp_concat = require('gulp-concat'),
gp_rename = require('gulp-rename'),
gp_uglify = require('gulp-uglify');
gulp.task('js-fef', function(){
return gulp.src(['file1.js', 'file2.js', 'file3.js'])
.pipe(gp_concat('concat.js'))
.pipe(gulp.dest('dist'))
.pipe(gp_rename('uglify.js'))
.pipe(gp_uglify())
.pipe(gulp.dest('dist'));
});
gulp.task('default', ['js-fef'], function(){});
如果要在發布后合並文件,則可以在瀏覽器中查看頁面源並下載捆綁軟件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.