Skip to content

numtel/meteor-publicsources

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

numtel:publicsources

Notice

🆕 This package has been made obsolete by the new numtel:lazy-bundles package.

By default, Meteor does not perform any special handling on files placed inside the public directory of your application.

With this package, you can place a custom.publicsources.json file in your application directory with a description of bundles of source files to process for client-side lazy-loading.

Source files will be transpiled and collected into a single .js and .css file for each bundle.

See a full application example...

Installation

meteor add numtel:publicsources

Bundle Description Syntax

Inside of a custom.publicsources.json file in the root of your application, you may describe bundles of source files to serve to the client. The filename may be different than custom.publicsources.json as long as it includes the extension .publicsources.json. (e.g. myapp.publicsources.json is also valid)

The following example will serve admin.js, admin.js.map, admin.css, and admin.css.map:

{
  "admin": [ 
    "admin/templates.html",
    "admin/styles.less",
    "admin/main.coffee"
  ]
}
  • Filenames presented are relative to the public directory. Files may also be loaded from the private directory (e.g. ../private/somefile.js)
  • Bundle names may contain slashes to simulate a directory path
  • .html files are automatically sorted to the beginning of a bundle but other template filetypes are not. Be sure to include template files like .jade first in the bundle so that subsequent scripts will have access to apply helpers, events and handlers.

Usage

Combine with a library loader integrated into iron:router for the full experience:

Notes

  • If adding a new source handler package (e.g. mquandalle:jade), you must restart Meteor for this package to recognize the change.

Test application

Test cases for this package are not executed using the normal meteor test-packages command. Instead, start the Meteor app inside of the test directory and see the status in the browser.

License

MIT

Portions copyright Maxime Quandalle @mquandalle

About

Create bundles in public directory for lazy-loading components

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages