Auto Copy a .js file to APP

3946
2
05-25-2015 10:51 AM
Drew
by
Occasional Contributor III

Hello,

I have about 5 widgets that all used a helper.js file I created.

Is there any way I can ensure this file is copied over when an app is created?

I stored the helper.js file in the widgets root directory.

Any ideas?

Drew

0 Kudos
2 Replies
Drew
by
Occasional Contributor III

Well i found one way but I would prefer a different way....

In the "stemapp" there is a "libs" folder.   I made my own folder  (myHelpers) in here  and pasted the .js files i needed to be included.

I can reference these libs using AMD now..

"myHelpers/helpers",

"myHelpers/lightWindow"

etc......

- I would prefer it not be be in the stemapp but this way works for now.

Drew

Drew
by
Occasional Contributor III

I also had to modify the init.js file to include a reference to the package.

Around like 132 there is a dojoConfig.packages[]

Its something like so....

     {

        name: "myHelpers",

        location: window.path + "myHelpers"

      }