Closed probins closed 10 years ago
i doubt that. Which closureBuilder option are you referring to? Share some examples.
Did you read the docs for all the available options for the builder task?
see --help:
"Paths to files can be expressed as individual arguments to the tool (intended for use with find and xargs). As a convenience, --root can be used to specify all JS files below a directory.
usage: closurebuilder.py [options] [file1.js file2.js ...]"
Indeed i see that's missing.
Do you require it? What is the use case? How do you imagine this being implemented in the config?
my main use case is where you have a directory with several source files, and you only want to build one of them. The workaround at the moment is to put each source in a separate directory and use --root=dir, but this is not optimal.
is there a particular reason the closureCompiler
task will not work for you?
compiler only has limited ability to create a dependency tree. My source requires
files from Closure library and from other 3rd-party code, so I create a build with the full dependencies with closureBuilder, and then pass that to the compiler
right...
so what i'd suggest for you is to work with namespaces. Make sure each bootstrap file has its own unique namespace, direct closureBulder to scan you entire dir tree and set the starting point to the specific namespace that you want to build. See options. namespaces
It's been some time since i last did significant work on this so i tend to forget, i just noticed in the docs this example:
* E.g. for
* files: [
* {src: 'lib/a.js', dest: 'build/a.min.js'},
* {src: 'lib/b.js', dest: 'build/b.min.js'},
* ],
Which i think is what you were originally looking for?
er, that example is for source maps
yes but it's derived from an actual way to define files. Did you try it?
Thanasis Polychronakis
On Wed, Feb 19, 2014 at 1:49 PM, Peter Robins notifications@github.comwrote:
er, that example is for source maps
— Reply to this email directly or view it on GitHubhttps://github.com/thanpolas/grunt-closure-tools/issues/57#issuecomment-35490557 .
yes but it's derived from an actual way to define files.
for the compiler. You define individual source files for the compiler, but if you try putting a file path in the src
option for builder, you get a 'not a directory' error.
However, I think you are right when you say I can define a namespace together with my source directory to get what I want without the need for using the arguments array. So I will close this now; if I find I still have issues, I'll reopen.
With closureBuilder, as well as (or instead of) specifying source directories in --root params, I can also specify individual source files as arguments. This ability seems to be missing in the Grunt task.