This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I have a somewhat odd use-case for web workbench. My current project is a mobile web app written in TypeScript and HTML with a Node.js backend. I do all of the web development using JetBrains WebStorm and use VS for editing the TypeScript sources. In order to work around the nasty habit of VS of writing all sorts of files and folders in your project folder, I have created a separate folder to host the VS project files and folder structure. I have added all my source files (*.ts) using the "Add->As Link" feature. 3rd party JS libraries are included as one normally would (using NuGet). I have created two empty js files: libs.js and app.js. The first is configured to bundle and minify all libraries, and the second is configured to include all of the js files generated by the TypeScript compiler. This works great so far, except WW keeps logging this when I build: // a bunch of JSHint lines (when processing the libs.js file) JSHint (881, 19): Too many errors. (3% scanned). I'd really like to be able to disable JSHint for the libs.js file, as it is "not my code" to maintain. It also says the following: Web Workbench created output files in the following directories which are not part of the project: * C:\Code\App\src\public\mobile\js\bundles Please include these folders to the project using Show Hidden Files and Include In Project. Ah, but they are not supposed to be part of the project! I've tried adding the bundled files as links (like I do with the .ts source files), but this doesn't make the warning go away. Any suggestions on how to make that warning go away? I like my builds to be clean :) And finally, I'm using .NET Demon (from Red Gate) to auto-compile on save. This correctly triggers the TypeScript compiler (via the Web Essentials extension), but does not trigger WW. For that to happen I need to save the empty app.js file or manually trigger a build. .NET Demon has an option to "replace the VS build system", but I am unsure what it does, and in any case the behavior is the same in both cases. Could you perhaps be persuaded to try WW with .NET Demon and see if you could make this scenario work? Thanks in advance, and sorry for bundling up a bunch of issues. |
|
|
I forgot to mention a feature request for WW: The TypeScript compiler produces not only a .js file, it can also emit a .js.map file that tools (debuggers) can use to link positions in the generated JS back to the original source. When bundling files this capability is lost. It'd therefore be awesome if WW could combine these also and write a single new map file for the bundled (non-minified) output. I'd also like to run a custom tool on the bundled output before minification, in order to strip out unnecessary lines. About the simplest possible TypeScript file will produce the following:
If you have a lot of files using the same module ("App" in the code above) then these could ideally be combined inside the same wrapper code (i.e. by removing the first three and bottom two lines). This is what I would have my custom tool do before minification. Of course, only if WW doesn't itself add this capability ;-) |
|
|
You can turn of JSHint execution globally under the Web Workbench options under Tools/Options by turning off the Static Analysis for JavaScript option (its the last one in the list). You cant control this on a per file basis currently though. In terms of the automated build we have recently added an option for triggering a compile on build which is available under the Web Workbench options in the Compilation section so have a look at if this covers what you need. The warning about files being generated which are not part of the project is not something that can be turned off but I will have a look at adding an option to suppress this if you just want to generally ignore this. We have been having a look at adding some kind of source map support but we dont have anything implemented yet but Ill take that as another vote of interest towards that :) Thanks for all the feedback and hope you have a nice break :)
|
|
|
FWIW I am already using the latest build and have enabled the automatic build option, to no avail. I'll keep an eye on the blog for updates related to any of this, thanks for listening and acknowledging the requests :) |
|