Skip to content

Commit

Permalink
add dependencies option to slugs
Browse files Browse the repository at this point in the history
  • Loading branch information
maccman committed Aug 3, 2011
1 parent 609a5d3 commit bfd8dc5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
node_modules
7 changes: 4 additions & 3 deletions src/slug.coffee
Expand Up @@ -11,6 +11,7 @@ class Slug
libs: []
public: './public'
paths: ['./app']
dependencies: []
port: process.env.PORT or 9294

constructor: (@options = {}) ->
Expand All @@ -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()
Expand All @@ -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
)

Expand Down

0 comments on commit bfd8dc5

Please sign in to comment.