-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exclude test folder from webpack compilation #15
Comments
Very interesting, nice catch. We should be able to hack something in gulp at least for cleanup. Would be nicer in webpack tho. Will have a look at some point. |
Will address this with gulp instead of webpack because
|
ok |
Was thinking to just cleanup the build after test, however this would mean that the local coverage data is lost, which I am not prepared to accept. Options instead are:
|
Digging a bit deeper, all it does is |
|
turns out we're using gradle instead of ant, so ant.properties aint gna do much |
Have a solution using cordova's beforeBuild hook. It isn't ideal though. I'd rather gradle ignored the test files rather than us deleting them in a beforeHook. https://cordova.apache.org/docs/en/dev/guide/appdev/hooks/index.html |
I'm happy enough from that last answer that there's no clean way of doing it in gradle at the moment. |
debating whether:
I think I will go with delete with the beforeHook because you can't guarantee npm test will do the cleanup for you. Moving instead of deleting is probably cleaner but can't be bothered with that faff. |
Maybe beforeCompile is perfect, nuke it from the assets folder |
Great! Using grdle would help only android builds, so using cordova hooks should solve the issue for android and ios! |
One more thing, "ionic run android" does not trigger the "before_compile" script. Would it be desirable to clean the test build folder when just running? If this is the case, changing from "before_compile" to " after_prepare" seems to solve the issue. changing color of console.log output would be nice too. :-D |
Wow, all great advice - thanks. It's much better now 82be26a |
If you decompile the current generated apk, the test folder is being included in the build and shipped with the apk.
I tried to add
exclude: [ /\.(e2e|spec)\.ts$/, /node_modules/, /test/ ]
to webpack.config.js, while it seems to be something right, it is not enough to avoid the packing of the www/build/test folder generated when the tests are executed. If it is too hard to make webpack ignore the folder, can we delete the www/build/test after the tests are executed?
The text was updated successfully, but these errors were encountered: