1

How can I add a bunch js files but include only one of them for client code? E.g. I need to use hammer.js and want add it as submodule. I can not simply add it in client/code/app cuz SS will try to load all contents of repo (including README.md).

vatson
  • 19
  • 2
  • Well. I can answer my own question. The guys at AOL for some reason decided to wrap any library in the modules, which are located in the `client/code` (exception is `client/code/libs`). This information was already known from the documentation. But I was hoping that there is a way to put third-party library in the `client/code` and include only one file from it. Look at [source](http://d.pr/GoBZ) and you'll see simply hardcore without any possibility to configure the behavior – vatson Apr 22 '12 at 13:00

1 Answers1

0

You can modify the code portion of your ss.client.define so that Socketstream will only load the files you specify (rather than every single file that resides in the client/code/app folder - which is the default behaviour).

E.g change this:

ss.client.define('main', {
  view: 'app.jade',
  css:  ['libs', 'app.styl'],
  code: ['app'], // This is loading every file within the client/code/app/ folder
  tmpl: '*'
});

to this:

ss.client.define('main', {
  view: 'app.jade',
  css:  ['libs', 'app.styl'],
  code: ['app/file1.js', 'app/file2.js', 'app/file4.js'], // SS will only load these files.
  tmpl: '*'
});
dbau
  • 16,009
  • 2
  • 21
  • 31