Permalink
Browse files

add dependencies option to slugs

  • Loading branch information...
maccman committed Aug 3, 2011
1 parent 609a5d3 commit bfd8dc59424865fc982e27f9ca44273ea062210c
Showing with 5 additions and 3 deletions.
  1. +1 −0 .gitignore
  2. +4 −3 src/slug.coffee
View
@@ -0,0 +1 @@
+node_modules
View
@@ -11,6 +11,7 @@ class Slug
libs: []
public: './public'
paths: ['./app']
+ dependencies: []
port: process.env.PORT or 9294
constructor: (@options = {}) ->
@@ -27,7 +28,6 @@ class Slug
server.get('/application.js', @createPackage().createServer())
server.use(express.static(@options.public))
server.listen(@options.port)
- @options.port
build: ->
package = @createPackage().compile()
@@ -39,16 +39,17 @@ class Slug
server = express.createServer()
server.use(express.static(@options.public))
server.listen(@options.port)
- @options.port
addPaths: (paths = []) ->
require.paths.unshift(path) for path in paths
# Private
createPackage: ->
+ require = [].concat(@options.dependencies)
+ require.push(@options.main)
hem.createPackage(
- require: @options.main
+ require: require
libs: @options.libs
)

0 comments on commit bfd8dc5

Please sign in to comment.