Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add dependencies option to slugs

  • Loading branch information...
commit bfd8dc59424865fc982e27f9ca44273ea062210c 1 parent 609a5d3
@maccman maccman authored
Showing with 5 additions and 3 deletions.
  1. +1 −0  .gitignore
  2. +4 −3 src/slug.coffee
View
1  .gitignore
@@ -0,0 +1 @@
+node_modules
View
7 src/slug.coffee
@@ -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,7 +39,6 @@ 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
@@ -47,8 +46,10 @@ class Slug
# Private
createPackage: ->
+ require = [].concat(@options.dependencies)
+ require.push(@options.main)
hem.createPackage(
- require: @options.main
+ require: require
libs: @options.libs
)
Please sign in to comment.
Something went wrong with that request. Please try again.