10 Sep 2013 2:30 AM #1
Steps to reproduce:-
1) Drag a JS Resource over to the Resources in the config inspector
2) populate the URL with the path the the external resource
3) Publish the project.
The file is now empty...
Am I doing something wrong?
10 Sep 2013 7:24 AM #2
Not sure what's going on yet but I will say you can't expect for publish to handle an external script.Phil Strong
10 Sep 2013 11:36 PM #3
11 Sep 2013 6:38 AM #4
OK I think I understand better. Can you give me steps to reproduce or a simple project that shows the issue? I'm thinking this is a bugPhil Strong
11 Sep 2013 11:34 PM #5
1) Create a new Architect 3 project
2) Drag a JS Resource from the Toolbox over to the Resources in the Project Inspector
3) I populate the url config variable with js/routines.js
4) I set my publish path to the site root arc3.
5) I save the project and publish.
At this point the js/routines.js will be overwritten with an empty routines.js
My workaround is to cut and paste the code from routines.js into the code window before saving, that way it's not overwritten with blank content.
I Used Architect V3.0.0 Build 1130
12 Sep 2013 6:18 AM #6
I've tried the following steps w/ that same build and it publishes the file fine. However I want to be sure you're not publishing into the same directory as your project right?
This is what I tested
What are your project and publish paths?
Also the js/routines.js is a file that existed prior to adding the js resource correct?
I know I'm missing something; help! ;pPhil Strong
12 Sep 2013 7:06 AM #7
That's right. The project save and project publish paths are different (in fact I tried it setting it the same as well) and the resource.js file existed already with code contained therein....
The js/resource.js file exists in the publish directory before publishing, is that the issue?
12 Sep 2013 7:53 AM #8
Ah I see now. You'll want to set the url of the js resource to the http location in the Sites
e.g. http://localhost/arc3/js/routines.js this will fix your issue.
by setting it to js/routines.js Architect is actually creating a new js file and then pushing that.Phil Strong
12 Sep 2013 11:07 PM #9
Thanks for looking at this. That sort of makes sense except its a shame that I cannot work relative to the publish directory rather than have to specify a full URL. That necessitates changing those references when I want to publish to another site URL :-(
Also, given that I specify the source of the ExtJS library relative to the site route would it not make sense to keep it consistent?
13 Sep 2013 12:42 PM #10
Yeah I see what you mean. The library path does not have the need to be included in the canvas as we know how to include it regardless of what you set as library base path. Js and css resources however must be included either locally (from w/ in the project) or externally http://
We agree this is not ideal and we should look into making this better.Phil Strong