dojo / cli-build-webpack

🚀 **DEPRECATED** Dojo 2 - cli command for building applications
http://dojo.io
Other
4 stars 19 forks source link

Use different tsconfigs for building with and without tests #177

Closed maier49 closed 7 years ago

maier49 commented 7 years ago

The following has been addressed in the PR:

Description: This updates the build so that it uses separate tsconfig files for dojo build and dojo build -t. dojo build would use a tsconfig file that only compiles sources files, and the tsconfig file for dojo build -t would also compile tests. Relies on dojo/cli-create-app#89 to create the separate config files in a new project. Resolves #113

matt-gadd commented 7 years ago

@maier49 could we do this by just providing specific test related options to ts-loader? rather than putting a dependency on the end user having to have a non-standard extra tsconfig in their project (especially if they are not using create-app?)

maier49 commented 7 years ago

@matt-gadd It appears that ts-loader ignores include or exclude options and defers to tsconfig. I tested include locally to make sure. I understand the concern about requiring an extra config file though. Maybe there's another approach to this but I'm struggling to think of one at the moment.

matt-gadd commented 7 years ago

Sorry I meant the ts-loader options (not the webpack loader options as in that issue). It looks like you can currently only provide the compilerOptions part of the tsconfig though. You can provide a separate tsconfig path like you have, so we could potentially write a temp file instead (effectively making it internal), but ideally it would be nice to just pass an object for the config, which we could perhaps explore as a PR to ts-loader?

agubler commented 7 years ago

I think we should at least create a temporary tsconfig for tests "on the fly" if we can't get the preferred solution. I really don't want to have to have a none standard tsconfig file in order to use the build and test command.

maier49 commented 7 years ago

Closing in favor of generating a temp test config on the fly or deferring to config in ts-loader if they accept a PR.