How to point to existing web-app/js files with Asset Pipeline Plugin

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to point to existing web-app/js files with Asset Pipeline Plugin

AleCaste
Hello all,
We have a lot of javascript files in the /web-app/js folder and we recently installed the Asset Pipeline Plugin... but just recently. The app is a few years old now.

We don't want to move all js files from /web-app/js folder to /grails-app/assets/javascripts folder since we might break some of the gsp files that are using those resources directly.

Let's suppose we have the file:
/web-app/js/myscript.js

We want to create a matching file in the assets folder...
/grails-app/assets/javascripts/myscript.js

... but that file should be empty except for one line like:
//=require /web-app/js/myscript.js

So the file in the assets folder only points to the real file in web-app folder.
The problem is that the above manifest line does not work.

The above might not make too much sense for just one file. But what we really want is to include several files (that already exist in /web-app/js folder) and use the Asset Pipeline Plugin to compile them all.

Is it possible?
Thanks a lot.
Reply | Threaded
Open this post in threaded view
|

RE: How to point to existing web-app/js files with Asset Pipeline Plugin

netwiser
Copied the content from Asset Pipe plugin document:

// FileName: admin/application.js
//= require table

The first place we will look is within "grails-app/assets/javascripts/admin/" We will proceed to do this within all of the asset sub folders across plugins after the main application is searched.

The next place we will look is the root of all grails-app/assets sub folders (i.e. "grails-app/assets//table.js", and "web-app/*/table.js" for plugins).

In all cases the applications assets folder takes precedence between the 2 search paths, but plugins get scanned as well.



Literally, you could create an in-place plugin to hold all your js files, but not sure it works or not.

Regards,

James

> Date: Fri, 9 May 2014 13:13:56 -0700

> From: [hidden email]
> To: [hidden email]
> Subject: [grails-user] How to point to existing web-app/js files with Asset Pipeline Plugin
>
> Hello all,
> We have a lot of javascript files in the /web-app/js folder and we recently
> installed the Asset Pipeline Plugin... but just recently. The app is a few
> years old now.
>
> We don't want to move all js files from /web-app/js folder to
> /grails-app/assets/javascripts folder since we might break some of the gsp
> files that are using those resources directly.
>
> Let's suppose we have the file:
> /web-app/js/myscript.js
>
> We want to create a matching file in the assets folder...
> /grails-app/assets/javascripts/myscript.js
>
> ... but that file should be empty except for one line like:
> //=require /web-app/js/myscript.js
>
> So the file in the assets folder only points to the real file in web-app
> folder.
> The problem is that the above manifest line does not work.
>
> The above might not make too much sense for just one file. But what we
> really want is to include several files (that already exist in /web-app/js
> folder) and use the Asset Pipeline Plugin to compile them all.
>
> Is it possible?
> Thanks a lot.
>
>
>
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/How-to-point-to-existing-web-app-js-files-with-Asset-Pipeline-Plugin-tp4656774.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
Reply | Threaded
Open this post in threaded view
|

RE: How to point to existing web-app/js files with Asset Pipeline Plugin

AleCaste
Thanks James.

The problem is that the javascript files are NOT files used by plugins.
They are files in the general /web-app folder of the grails app.

It seems the asset pipeline plugin looks for the files in both the /grails-app/assets folder and the /web-app folders OF THE REST OF THE PLUGINS INSTALLED... but not on the main /web-app folder.

Is there a way to tell it to look in there too?

By the way, I just read the message from Jeff...
http://grails.1312388.n4.nabble.com/Deprecating-The-Grails-Mailing-Lists-td4656735.html

... so I have posted this question on StackOverflow:
http://stackoverflow.com/questions/23573437/how-to-point-to-existing-web-app-js-files-with-asset-pipeline-plugin

I guess I'm a bit late for that, but anyway
Reply | Threaded
Open this post in threaded view
|

RE: How to point to existing web-app/js files with Asset Pipeline Plugin

David Estes
Hello , the reason the asset-pipeline does not look in the primary webapp is because it caused potential conflicts with the behavior of the resources plugin and we did not want these systems to clash during a migration.

Sent from my iPhone

> On May 9, 2014, at 4:34 PM, AleCaste <[hidden email]> wrote:
>
> Thanks James.
>
> The problem is that the javascript files are NOT files used by plugins.
> They are files in the general /web-app folder of the grails app.
>
> It seems the asset pipeline plugin looks for the files in both the
> /grails-app/assets folder and the /web-app folders OF THE REST OF THE
> PLUGINS INSTALLED... but not on the main /web-app folder.
>
> Is there a way to tell it to look in there too?
>
> By the way, I just read the message from Jeff...
> http://grails.1312388.n4.nabble.com/Deprecating-The-Grails-Mailing-Lists-td4656735.html
>
> ... so I have posted this question on StackOverflow:
> http://stackoverflow.com/questions/23573437/how-to-point-to-existing-web-app-js-files-with-asset-pipeline-plugin
>
> I guess I'm a bit late for that, but anyway
>
>
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/How-to-point-to-existing-web-app-js-files-with-Asset-Pipeline-Plugin-tp4656774p4656777.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

RE: How to point to existing web-app/js files with Asset Pipeline Plugin

AleCaste
That makes sense.
But shouldn't be a way to force the asset pipeline plugin to look into the primary web-app through some indications in the manifest?
In our case it make total sense since we have loads and loads of js files already in the primary webapp and the asset pipeline plugin could help us a lot compiling them for future views etc.