diff --git a/app/index.js b/app/index.js index 141d6e03..2c66ef7f 100644 --- a/app/index.js +++ b/app/index.js @@ -258,19 +258,13 @@ var AspnetGenerator = yeoman.generators.Base.extend({ break; case 'webbasic': this.sourceRoot(path.join(__dirname, '../templates/projects/' + this.type)); - // Grunt or Gulp - if (this.options.grunt) { - this.fs.copyTpl(this.templatePath('Gruntfile.js'), this.applicationName + '/Gruntfile.js', this.templatedata); - } else { - this.fs.copyTpl(this.templatePath('gulpfile.js'), this.applicationName + '/gulpfile.js', this.templatedata); - } // individual files (configs, etc) this.fs.copyTpl(this.sourceRoot() + '/../../Dockerfile.txt', this.applicationName + '/Dockerfile', this.templatedata); this.fs.copy(this.templatePath('.bowerrc'), this.applicationName + '/.bowerrc'); + this.fs.copy(this.templatePath('bundleconfig.json'), this.applicationName + '/bundleconfig.json'); this.fs.copy(this.sourceRoot() + '/../../gitignore.txt', this.applicationName + '/.gitignore'); this.fs.copyTpl(this.templatePath('bower.json'), this.applicationName + '/bower.json', this.templatedata); this.fs.copyTpl(this.templatePath('appsettings.json'), this.applicationName + '/appsettings.json', this.templatedata); - this.fs.copyTpl(this.templatePath('package.json'), this.applicationName + '/package.json', this.templatedata); this.fs.copyTpl(this.templatePath('project.json'), this.applicationName + '/project.json', this.templatedata); this.fs.copyTpl(this.templatePath('Program.cs'), this.applicationName + '/Program.cs', this.templatedata); // Properties @@ -343,7 +337,7 @@ var AspnetGenerator = yeoman.generators.Base.extend({ if(!this.options['skip-install'] && (this.type === 'web' || this.type === 'webbasic')) { process.chdir(this.applicationName); this.installDependencies({ - npm: true, + npm: false, bower: true, callback: this._showUsageHints.bind(this) }); diff --git a/templates/overrides/semantic/webbasic/bundleconfig.json b/templates/overrides/semantic/webbasic/bundleconfig.json new file mode 100644 index 00000000..5ae75176 --- /dev/null +++ b/templates/overrides/semantic/webbasic/bundleconfig.json @@ -0,0 +1,29 @@ +[ + { + "outputFileName": "wwwroot/css/site.min.css", + "inputFiles": [ + "wwwroot/css/site.css" + ], + "minify": { + "enabled": true + } + }, + { + "outputFileName": "wwwroot/js/site.min.js", + "inputFiles": [ + "wwwroot/js/site.js" + ], + "minify": { + "enabled": true + } + }, + { + "outputFileName": "wwwroot/js/semantic.validation.min.js", + "inputFiles": [ + "wwwroot/js/semantic.validation.js" + ], + "minify": { + "enabled": true + } + } +] diff --git a/templates/projects/webbasic/Gruntfile.js b/templates/projects/webbasic/Gruntfile.js deleted file mode 100644 index 27b3117e..00000000 --- a/templates/projects/webbasic/Gruntfile.js +++ /dev/null @@ -1,10 +0,0 @@ -/* - This file is the main entry point for defining grunt tasks and using grunt plugins. - Click here to learn more: https://docs.asp.net/en/latest/client-side/using-grunt.html -*/ -"use strict"; - -module.exports = function(grunt) { - grunt.initConfig({ - }); -}; diff --git a/templates/projects/webbasic/bundleconfig.json b/templates/projects/webbasic/bundleconfig.json new file mode 100644 index 00000000..6eadf24e --- /dev/null +++ b/templates/projects/webbasic/bundleconfig.json @@ -0,0 +1,20 @@ +[ + { + "outputFileName": "wwwroot/css/site.min.css", + "inputFiles": [ + "wwwroot/css/site.css" + ], + "minify": { + "enabled": true + } + }, + { + "outputFileName": "wwwroot/js/site.min.js", + "inputFiles": [ + "wwwroot/js/site.js" + ], + "minify": { + "enabled": true + } + } +] diff --git a/templates/projects/webbasic/gulpfile.js b/templates/projects/webbasic/gulpfile.js deleted file mode 100755 index 55871e61..00000000 --- a/templates/projects/webbasic/gulpfile.js +++ /dev/null @@ -1,45 +0,0 @@ -/// -"use strict"; - -var gulp = require("gulp"), - rimraf = require("rimraf"), - concat = require("gulp-concat"), - cssmin = require("gulp-cssmin"), - uglify = require("gulp-uglify"); - -var webroot = "./wwwroot/"; - -var paths = { - js: webroot + "js/**/*.js", - minJs: webroot + "js/**/*.min.js", - css: webroot + "css/**/*.css", - minCss: webroot + "css/**/*.min.css", - concatJsDest: webroot + "js/site.min.js", - concatCssDest: webroot + "css/site.min.css" -}; - -gulp.task("clean:js", function (cb) { - rimraf(paths.concatJsDest, cb); -}); - -gulp.task("clean:css", function (cb) { - rimraf(paths.concatCssDest, cb); -}); - -gulp.task("clean", ["clean:js", "clean:css"]); - -gulp.task("min:js", function () { - return gulp.src([paths.js, "!" + paths.minJs], { base: "." }) - .pipe(concat(paths.concatJsDest)) - .pipe(uglify()) - .pipe(gulp.dest(".")); -}); - -gulp.task("min:css", function () { - return gulp.src([paths.css, "!" + paths.minCss]) - .pipe(concat(paths.concatCssDest)) - .pipe(cssmin()) - .pipe(gulp.dest(".")); -}); - -gulp.task("min", ["min:js", "min:css"]); diff --git a/templates/projects/webbasic/package.json b/templates/projects/webbasic/package.json deleted file mode 100755 index 16a66434..00000000 --- a/templates/projects/webbasic/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "<%= namespace.toLowerCase() %>", - "version": "0.0.0", - "private": true, - "devDependencies": {<% if(!grunt){ %> - "gulp": "3.9.1", - "gulp-concat": "2.6.0", - "gulp-cssmin": "0.1.7", - "gulp-uglify": "1.5.3", - "rimraf": "2.5.2"<% } %><% if(grunt){ %> - "grunt": "1.0.1"<% } %> - } -} diff --git a/templates/projects/webbasic/project.json b/templates/projects/webbasic/project.json index 0ab37150..a651d37e 100755 --- a/templates/projects/webbasic/project.json +++ b/templates/projects/webbasic/project.json @@ -22,6 +22,13 @@ }, "tools": { + "BundlerMinifier.Core": { + "version": "2.0.208", + "imports": [ + "portable-net45+win8+dnxcore50", + "portable-net40+sl5+win8+wp8+wpa81" + ] + }, "Microsoft.AspNetCore.Razor.Tools": { "version": "1.0.0-preview1-final", "imports": "portable-net45+win8+dnxcore50" @@ -68,7 +75,7 @@ }, "scripts": { - "prepublish": [ "npm install", "bower install"<% if(!grunt){ %>, "gulp clean", "gulp min"<% } %> ], + "prepublish": [ "bower install" ], "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] }, diff --git a/test/test-core.js b/test/test-core.js index b945541a..f1c305cb 100644 --- a/test/test-core.js +++ b/test/test-core.js @@ -555,53 +555,6 @@ describe('aspnet - Web Application (Semantic UI)', function() { }); - -/* - * yo aspnet Web Application Basic - Grunt option - */ -describe('aspnet - Web Application Basic w/grunt', function() { - - util.goCreateApplicationWithOptions('webbasic', 'gruntTest', 'bootstrap', { - grunt: 'grunt' - }); - - describe('Checking directories', function() { - it('Application directory created', function() { - assert.file('gruntTest/'); - }); - - it('grunt file created', function() { - assert.file('gruntTest/Gruntfile.js'); - }); - - it('gulpfile does NOT exist', function() { - assert.noFile('gruntTest/gulpfile.js'); - }); - }); -}); - -/* - * yo aspnet Web Application Basic - No Grunt option - */ -describe('aspnet - Web Application Basic w/o grunt', function() { - - util.goCreateApplication('webbasic', 'gulpTest'); - - describe('Checking directories', function() { - it('Application directory created', function() { - assert.file('gulpTest/'); - }); - - it('gulp file created', function() { - assert.file('gulpTest/gulpfile.js'); - }); - - it('grunt file does NOT exist', function() { - assert.noFile('gulpTest/Gruntfile.js'); - }); - }); -}); - /* * yo aspnet Web Application (Bootstrap) */ @@ -658,10 +611,9 @@ describe('aspnet - Web Application Basic (Bootstrap)', function() { 'webTest/.bowerrc', 'webTest/.gitignore', 'webTest/bower.json', + 'webTest/bundleconfig.json', 'webTest/appsettings.json', 'webTest/Controllers/HomeController.cs', - 'webTest/gulpfile.js', - 'webTest/package.json', 'webTest/Program.cs', 'webTest/project.json', 'webTest/Properties/launchSettings.json', @@ -759,8 +711,6 @@ describe('aspnet - Web Application Basic (Semantic UI)', function() { 'webTest/bower.json', 'webTest/appsettings.json', 'webTest/Controllers/HomeController.cs', - 'webTest/gulpfile.js', - 'webTest/package.json', 'webTest/Program.cs', 'webTest/project.json', 'webTest/Properties/launchSettings.json',