dojo / cli-build-webpack

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

dojo build -t -w doesn't work #259

Closed denyskorolkov closed 6 years ago

denyskorolkov commented 6 years ago

Bug

dojo build -t -w doesn't work. Separately both (dojo build -w & dojo build -t) work correctly.

Expected behavior:

Update files in the _build directory when they changed in src, tests directories.

Actual behavior:

The _build directory wasn't created in the root.

agubler commented 6 years ago

Hi @denyskorolkov, watch is not currently supported for building with tests. watch uses webpack dev server that builds bundles in memory and not physical files that are required to run the tests.

denyskorolkov commented 6 years ago

Hi @agubler, I would like to use the next combination:

This combination may help me to see the live test result of my code in a browser without the need to run dojo test every time. Maybe do you know a more appropriate solution?

agubler commented 6 years ago

@denyskorolkov at the moment using cli-build-webpack, dojo build -t will need to be re-run in order to see the results of code changes when running tests in the browser.

However we are working on a new package, cli-build-app, which will support watching and building tests and is scheduled to be released for the next beta (beta5).

denyskorolkov commented 6 years ago

@agubler Thanks for the information. I will be tracking your progress with huge interest.

agubler commented 6 years ago

Hey @denyskorolkov, we've released @dojo/cli-build-app@0.1.0 (compatible with @dojo/cli-test-intern@0.4.0) that will be part of the upcoming beta5 release. This will allow building the tests under watch so you will be able to run the tests in the browser without having to re-run the build every time!

The command to build the tests on a watch is:

dojo build --mode test --watch
denyskorolkov commented 6 years ago

Thanks, @agubler. I've tried and it works but I have a question. Should I run web server separately or not? Now I run dojo build --mode test --watch and npx intern serveOnly

agubler commented 6 years ago

Hey @denyskorolkov, at the moment you will need to run a web server separately (as you've been doing) from the root of the project as currently --serve serves the output/test.

We will open a new issue on cli-build-app to consider serving from the project root or disabling serve for the test mode entirely.

I hope that helps, thanks!