oh ok, so hard code the meta-inf/assets part -- but this won't use the checksum cache key - which i suppose is ok since it isn't updated often.

cheers.

On 13/11/2014 4:46 PM, Geoff Callender wrote:
public class YourJavaScriptStack implements JavaScriptStack {

        private final AssetSource assetSource;

        public YourJavaScriptStack(final AssetSource assetSource) {
                this.assetSource = assetSource;
        }

        // etc

and when you set up a StyleSheetLink, the asset is like this:

        assetSource.getClasspathAsset("/META-INF/assets/blahblah.css");

and in AppModule:

        public static void 
contributeJavaScriptStackSource(MappedConfiguration<String, JavaScriptStack> 
configuration) {
                configuration.addInstance("YourJavaScriptStack", 
YourJavaScriptStack.class);
        }

Geoff

On 13 Nov 2014, at 4:33 pm, Paul Stanton <pa...@mapshed.com.au> wrote:

Hi all,

I am trying to include some non-requirejs resources in the most recommended 
way. In this case, a javascript package which requires some css.

 From what I can tell the recommended approach is to 'shim' it in from the location 
"META-INF/assets", which I've done

    public static void contributeModuleManager(MappedConfiguration<String, 
Object> configuration,
            @Path("/META-INF/assets/project/script.js") Resource js)
    {
        configuration.add("project", new JavaScriptModuleConfiguration(js));
    }

I would like the css to live in the same dir.

Since the JS will never be used without the CSS, a stack seems to be the best 
way to include it.

I can easily include the module js in the stack, however since the css asset 
lives in the same location I cannot find a way to correctly create the asset.

 From what I can tell the only way to resolve the correct "meta-inf/assets" 
path is via AssetSource.getComponentAsset() however I cannot aquire ComponentResources at 
this point.

Can someone please fill me in on the correct way to create a stack for shimmed 
modules with additional resources?

thanks, p.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to