-
Notifications
You must be signed in to change notification settings - Fork 81
Request: support for files as well as directories in createPackage #8
Comments
I found my feet with CoffeeScript and had a go at implementing this, but quickly realized the problem: this currently fails as there's nothing for getRelativePath() to calculate relative to, which makes sense; this needs a higher level solution. One possibility would be to allow the 'paths' config to be an array of string-or-object, where strings must be directories and objects might be something like
Or, for greater flexibility, 'files' could 'includes'/'excludes' as an array of filenames and/or glob patterns. Thoughts? |
It should be possible to organize your files in such a way that all browser-dependent files live in one tree, and all other files live in another tree. In Node, for example, the |
Closing this for now, but feel free to reopen if you have a case where it's not possible to split your app up into multiple trees. |
My main concern isn't the code I write, and which I can organize into separate trees; it's if the files that need to be split into separate trees live in a module I don't control. For example, suppose I come across some module that has a collection of utility routines that I want to be able to use in code I'll share CS/SS. If that module has additional code/files that I don't want to bundle to the client, I have to copy the utility routines into my shared tree. This is a real use-case -- something I'm doing today -- and currently file copying is the only thing I can do to get those third-party dependancies to the browser without including other files from the same source tree. |
Having the same issue: My code require()s parse-js from UglifyJS, but I don't want the rest of of UglifyJS. So either I need to be able to specify a single file or, better yet, Stitch should notice the require('../vendor/UglifyJS/lib/parse-js') in my code and automatically include that file into the package. |
I'm having the same problem. I'm working on a mobile webapp and each user role has a different app/module. So for each role i don't want to merge all the files and each module will have shared javascript. |
I've also thought about resolving dependencies and I think, regexp for |
I'd like to be able to createPackage({ paths: ['path/to/file.js']}) so that I can export sub-modules individually; it's not always appropriate/desirable to export all the files in a given directory and at the moment my only option, assuming a third party module whose file structure I don't control, is to copy the files I do want to export into a separate directory.
The text was updated successfully, but these errors were encountered: