Skip to content
This repository was archived by the owner on Feb 13, 2019. It is now read-only.

Commit fdfa330

Browse files
Introduce Bundler to web basic (StarterWeb) template
This commit brings changes from aspnet/Templates#592 to starter web project template. The Gulp, Grunt options are removed with NPM support removal. Thanks!
1 parent f05d807 commit fdfa330

File tree

7 files changed

+30
-127
lines changed

7 files changed

+30
-127
lines changed

app/index.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -258,19 +258,13 @@ var AspnetGenerator = yeoman.generators.Base.extend({
258258
break;
259259
case 'webbasic':
260260
this.sourceRoot(path.join(__dirname, '../templates/projects/' + this.type));
261-
// Grunt or Gulp
262-
if (this.options.grunt) {
263-
this.fs.copyTpl(this.templatePath('Gruntfile.js'), this.applicationName + '/Gruntfile.js', this.templatedata);
264-
} else {
265-
this.fs.copyTpl(this.templatePath('gulpfile.js'), this.applicationName + '/gulpfile.js', this.templatedata);
266-
}
267261
// individual files (configs, etc)
268262
this.fs.copyTpl(this.sourceRoot() + '/../../Dockerfile.txt', this.applicationName + '/Dockerfile', this.templatedata);
269263
this.fs.copy(this.templatePath('.bowerrc'), this.applicationName + '/.bowerrc');
264+
this.fs.copy(this.templatePath('bundleconfig.json'), this.applicationName + '/bundleconfig.json');
270265
this.fs.copy(this.sourceRoot() + '/../../gitignore.txt', this.applicationName + '/.gitignore');
271266
this.fs.copyTpl(this.templatePath('bower.json'), this.applicationName + '/bower.json', this.templatedata);
272267
this.fs.copyTpl(this.templatePath('appsettings.json'), this.applicationName + '/appsettings.json', this.templatedata);
273-
this.fs.copyTpl(this.templatePath('package.json'), this.applicationName + '/package.json', this.templatedata);
274268
this.fs.copyTpl(this.templatePath('project.json'), this.applicationName + '/project.json', this.templatedata);
275269
this.fs.copyTpl(this.templatePath('Program.cs'), this.applicationName + '/Program.cs', this.templatedata);
276270
// Properties

templates/projects/webbasic/Gruntfile.js

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"outputFileName": "wwwroot/css/site.css",
4+
"inputFiles": [
5+
"wwwroot/css/site.css"
6+
],
7+
"minify": {
8+
"enabled": true
9+
}
10+
},
11+
{
12+
"outputFileName": "wwwroot/js/site.js",
13+
"inputFiles": [
14+
"wwwroot/js/site.js"
15+
],
16+
"minify": {
17+
"enabled": true
18+
}
19+
}
20+
]

templates/projects/webbasic/gulpfile.js

Lines changed: 0 additions & 45 deletions
This file was deleted.

templates/projects/webbasic/package.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

templates/projects/webbasic/project.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222
},
2323

2424
"tools": {
25+
"BundlerMinifier.Core": {
26+
"version": "2.0.200",
27+
"imports": [
28+
"portable-net45+win8+dnxcore50",
29+
"portable-net40+sl5+win8+wp8+wpa81"
30+
]
31+
},
2532
"Microsoft.AspNetCore.Razor.Tools": {
2633
"version": "1.0.0-preview1-final",
2734
"imports": "portable-net45+win8+dnxcore50"
@@ -68,7 +75,7 @@
6875
},
6976

7077
"scripts": {
71-
"prepublish": [ "npm install", "bower install"<% if(!grunt){ %>, "gulp clean", "gulp min"<% } %> ],
78+
"prepublish": [ "bower install" ],
7279
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
7380
},
7481

test/test-core.js

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -555,53 +555,6 @@ describe('aspnet - Web Application (Semantic UI)', function() {
555555

556556
});
557557

558-
559-
/*
560-
* yo aspnet Web Application Basic - Grunt option
561-
*/
562-
describe('aspnet - Web Application Basic w/grunt', function() {
563-
564-
util.goCreateApplicationWithOptions('webbasic', 'gruntTest', 'bootstrap', {
565-
grunt: 'grunt'
566-
});
567-
568-
describe('Checking directories', function() {
569-
it('Application directory created', function() {
570-
assert.file('gruntTest/');
571-
});
572-
573-
it('grunt file created', function() {
574-
assert.file('gruntTest/Gruntfile.js');
575-
});
576-
577-
it('gulpfile does NOT exist', function() {
578-
assert.noFile('gruntTest/gulpfile.js');
579-
});
580-
});
581-
});
582-
583-
/*
584-
* yo aspnet Web Application Basic - No Grunt option
585-
*/
586-
describe('aspnet - Web Application Basic w/o grunt', function() {
587-
588-
util.goCreateApplication('webbasic', 'gulpTest');
589-
590-
describe('Checking directories', function() {
591-
it('Application directory created', function() {
592-
assert.file('gulpTest/');
593-
});
594-
595-
it('gulp file created', function() {
596-
assert.file('gulpTest/gulpfile.js');
597-
});
598-
599-
it('grunt file does NOT exist', function() {
600-
assert.noFile('gulpTest/Gruntfile.js');
601-
});
602-
});
603-
});
604-
605558
/*
606559
* yo aspnet Web Application (Bootstrap)
607560
*/
@@ -658,10 +611,9 @@ describe('aspnet - Web Application Basic (Bootstrap)', function() {
658611
'webTest/.bowerrc',
659612
'webTest/.gitignore',
660613
'webTest/bower.json',
614+
'webTest/bundleconfig.json',
661615
'webTest/appsettings.json',
662616
'webTest/Controllers/HomeController.cs',
663-
'webTest/gulpfile.js',
664-
'webTest/package.json',
665617
'webTest/Program.cs',
666618
'webTest/project.json',
667619
'webTest/Properties/launchSettings.json',
@@ -759,8 +711,6 @@ describe('aspnet - Web Application Basic (Semantic UI)', function() {
759711
'webTest/bower.json',
760712
'webTest/appsettings.json',
761713
'webTest/Controllers/HomeController.cs',
762-
'webTest/gulpfile.js',
763-
'webTest/package.json',
764714
'webTest/Program.cs',
765715
'webTest/project.json',
766716
'webTest/Properties/launchSettings.json',

0 commit comments

Comments
 (0)