mattgoldspink / grunt-sencha-dependencies

Grunt task to get the list of Ext.require dependencies in your application
MIT License
32 stars 22 forks source link

ext-debug.js is missing from start of concat list #1

Closed mattgoldspink closed 11 years ago

mattgoldspink commented 11 years ago

Should probably make this configurable - let people say the name of the file they want to include, but by default OK include ext-debug.is or sencha-touch-debug.js

yetit commented 10 years ago

When using http://www.mattgoldspink.co.uk/2013/02/10/using-grunt-with-ext-js-4-x-projects/ this example get an error because of using ext-all.js in index.html, and sencha-dependencies uses as core-file ext-debug.js

As a temporary solution comment /files.push(coreFile);/ in /node_modules/grunt-sencha-dependencies/tasks/lib/PhantomJsHeadlessAnalyzer.js

But as for me it's very bad solution...

mattgoldspink commented 10 years ago

@yetit Thanks for the report - I have a much better example here https://github.com/mattgoldspink/grunt-extjs-example which works out of the box and includes a bunch of extra common grunt plugins (like jasmine tests and code coverage). That said I'll take a look to see if I can correct the issue you hit

pablix commented 10 years ago

Hi Matt

In our project we have the same problem that @yetit reported. We would need to remove 'ext-debug.js' from generated 'sencha_dependencies_dist' list because 'ext.js' it's already included in our 'index.html' page.

For us it would be very useful to have a new configuration option to choose the included extjs library. And of course, the empty value could be used to choose no library at all :-)

mattgoldspink commented 10 years ago

Hi Pablo,

Is it possible for you to share your project or a very simple reproduction, perhaps a gist of your Gruntfile.js and index.html would be enough for me to understand how you're using it and then add an appropriate feature to fix it.

Thanks, Matt — Sent from Mailbox for iPhone

On Thu, Dec 19, 2013 at 11:25 AM, Pablo Jimenez Mayor notifications@github.com wrote:

Hi Matt In our project we have the same problem that @yetit reported. We would need to remove 'ext-debug.js' from generated 'sencha_dependencies_dist' list because 'ext.js' it's already included in our 'index.html' page. For us it would be very useful to have a new configuration option to choose the included extjs library. And of course, the empty value could be used to choose no library at all :-)


Reply to this email directly or view it on GitHub: https://github.com/mattgoldspink/grunt-sencha-dependencies/issues/1#issuecomment-30921856

pablix commented 10 years ago

Thanks for your quick response! I will try to prepare a simple test case. Out bootstrap process is complex because we use a custom loader mechanism to load Ext Application and controllers dynamically. The key is that we need to include 'ext.js' library in our index.html file, to make it available before the loading mechanism starts, that's why we need to exclude it from our minified javascript with the app code.

mattgoldspink commented 10 years ago

@pablix I added a new property called exclude which takes an array of filepaths/urls to exclude from the final generated list of dependencies. It's been pushed into 0.8.0. Could you try that out and see if it works for you?

pablix commented 10 years ago

Thanks Matt, it works great!. Here is my 'Gruntfile.js' configuration:

...
sencha_dependencies: {
            dist: {
                options: {
                    pageRoot: 'src/',
                    includeAllScriptTags: false,
                    pageToProcess: 'index.html',
                    exclude: [
                        'src/lib/ext/ext-debug.js'
                    ]
                }
            }
        }
...

And now 'ext-debug.js' file is not included into the list, great!

BTW, I've been working on a different solution, with a new property called 'senchaCoreFile' that allows to choose the included extjs library (to solve @yetit issue and mine, because it allows an empty value to not include the library). Check it out at https://github.com/pablix/grunt-sencha-dependencies/compare/master...task;configurable_coreFile, I think it's compatible with your new property. If you are interested in merging it in your master branch, let me know :-)