-
Notifications
You must be signed in to change notification settings - Fork 122
-
Notifications
You must be signed in to change notification settings - Fork 122
Preprocess and transpile without bundling #727
Comments
Thanks! Yes exactly polishing the workflows around this use case is important. There is |
Ahhhh!! Interesting. I will take a look at that. Are there any docs for |
With this strategy, I would want all of my plugin loaders to run at this compile time. How should I handle non-JS files being wrapped into JS files? For example, I have a file "resource.txt" that I am I think I want to save it as a new file in my build directory as "resource.txt.js", but then how do I handle the import in the file that requests it? It would still be looking for "resource.txt". Also, I think there are depCache considerations.. I am just wondering if there is a preferred or suggested way of doing this. |
This is always a tricky problem, and with a "blind" single-file compile you're best bet is to just keep the extension Lots of people seem to think thats odd, but I quite like that sort of workflow. Renaming / moving options for modules in the builder are limited, but this is an area that could certainly be explored in future (eg |
Awesome, thanks for your suggestion on that. So, it appears not many people (if any) are trying to do what I want, especially since the |
Do you have any workflow advice for processing without bundling? Currently, I am However, at production runtime, the jspm's generated metata .json file is still being requested. I would think that the info needed from the .json files in For example:
404's on FYI, I'm using JSPM 0.17 beta-31 |
Ha! I continued my search through the source code and found the answer to that piece of the puzzle: There is an option to get the configs, In the resulting array, the parsed object has a flag, "isPackageConfig" that I can key off of to determine whether to compile or to copy. Also, when I have a good solution, I plan to create a gulp wrapper for this use case. |
@joeljeske I believe I'm looking for nearly the same functionality you are. I'm working on a development/production server that automatically transpiles your scripts without any code changes needed. You can just |
@guybedford Is there a way to use |
@lastmjs, that's what |
@asapach I want the semantics of compile though. I don't want a bundle, I just want each file compiled into a self-executing file without its dependencies included. Is that what buildStatic does? The way I've been using it, it bundles. |
@lastmjs, I'm confused. If you're not including the dependencies into your self-executing file, how are they resolved? SFX bundles don't use SystemJS runtime, they include their own. |
@asapach Maybe I'm confused then. Here's what I do know, if I use |
That's incorrect: the module will not be executed until you do Static bundles don't load any dynamic dependencies (hence the name), because all their dependencies need to be included in the bundle at build time. You can't have it both ways. You can try webpack with their code splitting and chunking, etc. |
@lastmjs, as @guybedford mentioned in his initial response to my issue, there already exists middle-ware that supports server-side just-in-time transpilation using |
@asapach Okay, I see. Thank you for explaining that. Thanks @joeljeske That project is only for express. I'm working on a general purpose HTTP server. |
@lastmjs, it appears it is already general purpose or is close to it. |
First, thanks for your forward thinking and hard work!
I currently have a project using JSPM. In development, I am using system.js to transpile and wrap modules JIT in the browser.
For production, I want to serve every JS file individually, taking advantage of
depCache
and HTTP/2 to download deps in parallel. My issue, is that I do not see the systemjs builder command to preprocess and transpile all of my JS and other assets into static and individual JS files. I only see options to build and bundle an entire dependency chain given an entry point into a single file.I am looking for an API to pass in an entry point and it prepares all of my assets as individual JS files to be loaded in production.
I am likely simply missing something, as this seems like the primary advantage of SystemJS.
Thanks!
The text was updated successfully, but these errors were encountered: