aspnet / Templates

This repo is OBSOLETE - please see the README file for information
Other
150 stars 57 forks source link

Exclude bower components from buildOptions in project.json #635

Closed ghost closed 7 years ago

ghost commented 8 years ago

Hi Guys,

Following this issue: Wrong assembly information / exe file details (dotnet/cli #3620)...

Can you consider in new templates to exclude lib (bower components) or wwwroot folder from buildOptions in project.json by default ?

For example:

"buildOptions": {
  "compile": {
    "exclude": [ "lib" ]
  }
}

Currently (.NET Core RC2) new project created from default template in VS2015 not contain the AssemblyInfo.cs file... It's mean that assembly information are taken form project.json - that's fine, but AssemblyInfo.cs it's still 'higher priority' file, and it's used if exist anywhere in the project...

It's mean that we have mess if we don't have our own AssemblyInfo.cs file (by default), but any of 3rd-party library (included by bower) contains that file (from any reason) - in that case this 3rd-party file will be taken as source of assembly information - it confuse if you don't know about this ;)

Excluding 'lib' folder (bower components) from compilation, seems to be good enough solution - maybe it's worth to sort this by default in the new projects templates ?

Thanks in advance.

peterblazejewicz commented 8 years ago

Any 3rd party dependency can bring down your project build: https://github.com/aspnet/Templates/pull/603#issuecomment-225704289

Folks, why entire web root path can't be excluded by default in web app templates? Entire directories are included in rules: https://github.com/aspnet/Templates/blob/dev/src/BaseTemplates/StarterWeb/project.json#L54-L56

ghost commented 8 years ago

I can agreed about NPM as it's not necessary for project and seems to be not included in new project by default.

My case is about lib folder which is included in new project by default and contains Bower components (like a Bootstrap or jQuery). I see no point to include it for compilation of my own project, moreover I have no control on what is included in 3rd party libs...

Of course excluding lib form compilation is one way, and second (maybe better) is describe this case in official docs (aspnet/Docs #1525) - if you are aware about that you can decide how to configure your project...

I loose few hours to figured out where is problem, because I was not aware about this ;)

mlorbetske commented 7 years ago

This is fixed by the move to msbuild