chidimo
chidimo

Reputation: 2958

Meteor.js doesn't load content of lib folder

I'm new to meteor.js.

I started a new app using meteor create textcircle. I then added a package using meteor add edemaine:sharejs-codemirror

The problem is, in my app directory, I created a folder, lib, then a file lib/collections.js. Inside lib/collections.js I have this single line console.log('Lib folder loaded'). But I don't see the text on the console. Not in google chrome console, neither in my terminal. This shows that the file is clearly not loaded. Any thoughts would be appreciated.

meteor --version outputs Meteor 1.8

Upvotes: 1

Views: 585

Answers (1)

Tom Freudenberg
Tom Freudenberg

Reputation: 1367

you need to import your files in client oder server main.js.

Lets assume you have also a folder named client.

inside that folder there is a file main.js.

import '../lib/collections.js';

Now your browsers console should show up the log.

If you have also a folder server and inside a file main.js

import '../lib/collections.js';

You will see the log also on your meteors console log.

Hope that helps Tom

Upvotes: 2

Related Questions