Search code examples
visual-studiouwpvisual-studio-2017winjs

In a Windows 10 UWP WinJS App, how can I decide which files get included in the build?


I'm building a UWP app with javascript and in a subfolder, I have a node_modules folder and a bunch of files that are there for compilation and debugging, but should not be in the final build.

I don't know how to include or exclude folders from the build, but it's important that I am able to keep them visible in the project.


Solution

  • I don't know how to include or exclude folders from the build.

    When you build a project that contains several files, you can list each file separately in the project file, or you can use wildcards to include all the files in one directory or a nested set of directories. And you can explicitly exclude that file or directory from the list of inputs. There may also be a file in a project that you only want to include under certain conditions. You can explicitly declare the conditions under which a file is included in a build. For more detail you could refer MSBuild Items official document.

    I have a node_modules folder and a bunch of files that are there for compilation and debugging, but should not be in the final build.

    Please refer the following screenshot, if you have set file Package Action as Content the file will be selected to build. You could check if the value is correct.

    enter image description here