这是indexloc提供的服务,不要输入任何密码
Skip to content

Before Hook Promise #754

@richardmatthewsdev

Description

@richardmatthewsdev

Hey,

I am having an issue with the before hook on app.coffee where the Roots compilation doesn't appear to wait for the promise to be resolved before compiling.

In an empty Roots project, I would expect that this code would cause Roots to never compile.

axis         = require 'axis'
rupture      = require 'rupture'
autoprefixer = require 'autoprefixer-stylus'
js_pipeline  = require 'js-pipeline'
css_pipeline = require 'css-pipeline'

promise = ->
  return new Promise((resolve, reject) ->

  )

module.exports =
  ignores: ['readme.md', '**/layout.*', '**/_*', '.gitignore', 'ship.*conf']

  extensions: [
    js_pipeline(files: 'assets/js/*.coffee'),
    css_pipeline(files: 'assets/css/*.styl')
  ]

  stylus:
    use: [axis(), rupture(), autoprefixer()]
    sourcemap: true

  'coffee-script':
    sourcemap: true

  before: promise

  jade:
    pretty: true

This is a problem for me because I am trying to fetch content from an API in multiple requests and I am needing Roots to wait until all of the requests have been made before it compiles the site.

Any help would be much appreciated!

Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions