wyc
wyc

Reputation: 55353

Why is the first api.add_files not being included?

I have the following:

scribe/package.js:

Package.describe({
  summary: 'A rich text editor framework for the web platform http://guardian.github.io/scribe/'
});

Package.on_use(function(api) {
  api.add_files('require.js', 'client');
  api.add_files('scribe.js', 'client');
});

For some reason I'm getting this error:

Uncaught ReferenceError: define is not defined 

Because require.js doesn't show up in the rendered page. Why is that?

File tree:

enter image description here

Upvotes: 0

Views: 236

Answers (1)

Hubert OG
Hubert OG

Reputation: 19544

You need to export all the top global variables from the package. Add this line before the api.add_filescall:

api.export('define')

Add a similar line for every global variable you'd like to be abke to use outside of the package.

Upvotes: 1

Related Questions