Sato
Sato

Reputation: 8602

How to convert package into pure js files?

I am currently on a project made with meteor, and former developer created some packages, and the project looks like this:

/projectName
|- /client
|- /server
|- /lib
|- /packages
|- /packages/projectName-packageName1
|- /packages/projectName-packageName2

And the team leader asked me to rebuild the project with meteor 1.x and move all packages under /pacakages into /lib.

I'm new to meteor and tried to move the files under /packages into /lib directly and of course with no success.

Could you please intelligent me how to do this?

Upvotes: 0

Views: 60

Answers (1)

Ethaan
Ethaan

Reputation: 11376

Well you can just copy paste the code but you should aware on some things.

If your packages are only server side or don't play with DOM Elements or the Window Object it should work, just be sure that you have all the dependencies this packages need to work.(the /lib folder is shared between server/client and the Window Object dosnt exists on the server).

First open the package.js of each package and see wich files belongs to the server and wich files belongs to the client, so just grab that files and put under the respective folder /client /server or /both.

Second take a look into api.use, for example.

api.use('coffeescript','client')

if you have something like this now you should do a meteor add coffeescript manual.

Also since meteor loads first the package before any other file/folder inside the app, you should be aware about how the apps load now.

But in resume yes, you can just copy paste the code/files and put them in the correct folder and it should work.

Upvotes: 1

Related Questions