Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable DEBUG=gatsby:* gatsby develop #99

Merged
merged 1 commit into from
Dec 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/utils/develop.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var webpackRequire = require('webpack-require');
var fs = require('fs')
var assign = require('object-assign')
var getUserGatsbyConfig = require('./get-user-gatsby-config');
var debug = require('debug')('gatsby:application');

var globPages = require('./glob-pages');
var webpackConfig = require('./webpack.config');
Expand All @@ -23,6 +24,7 @@ module.exports = function(program) {

// Load pages for the site.
return globPages(directory, function(err, pages) {

// Generate random port for webpack to listen on.
// Perhaps should check if port is open.
var webpackPort = Math.round(Math.random() * 1000 + 1000);
Expand All @@ -34,9 +36,11 @@ module.exports = function(program) {

var HTMLPath;
if (fs.existsSync(directory + "/html.cjsx") || fs.existsSync(directory + "/html.jsx")) {
debug('using project\'s html wrapper');
HTMLPath = directory + "/html"
}
else {
debug('using gatsby default html wrapper');
HTMLPath = __dirname + "/../isomorphic/html"
}

Expand All @@ -49,6 +53,7 @@ module.exports = function(program) {
err.forEach(function(error) { console.log(error) })
process.exit()
}
debug('configuring server');
var HTML = factory()

var webpackDevServer = new WebpackDevServer(compiler, {
Expand Down Expand Up @@ -111,6 +116,7 @@ module.exports = function(program) {

if (negotiator.mediaType() === "text/html") {
request.setUrl("/html" + request.path);

return reply.continue();
} else {
// Rewrite path to match disk path.
Expand Down
2 changes: 2 additions & 0 deletions lib/utils/glob-pages.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ fs = require 'fs'
frontMatter = require 'front-matter'
_ = require 'underscore'
toml = require('toml')
debug = require('debug')('gatsby:glob')

module.exports = (directory, callback) ->
# Read in site config.
Expand Down Expand Up @@ -73,4 +74,5 @@ module.exports = (directory, callback) ->

pagesData.push pageData

debug('globbed', pagesData.length, 'pages');
callback(null, pagesData)
2 changes: 2 additions & 0 deletions lib/utils/post-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var fs = require('fs-extra');
var async = require('async');
var parsePath = require('parse-filepath');
var _ = require('underscore');
var debug = require('debug')('gatsby:post-build');

var globPages = require('./glob-pages');

Expand All @@ -13,6 +14,7 @@ module.exports = function(program, cb) {

return globPages(directory, function(err, pages) {

debug('copying files');
// Async callback to copy each file.
var copy = function(file, callback) {
// Map file to path generated for that directory.
Expand Down
2 changes: 2 additions & 0 deletions lib/utils/static-generation.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ webpack = require 'webpack'
globPages = require './glob-pages'
webpackConfig = require './webpack.config'
getUserGatsbyConfig = require './get-user-gatsby-config'
debug = require('debug')('gatsby:static')

module.exports = (program, callback) ->
{relativeDirectory, directory} = program

globPages directory, (err, pages) ->
debug('generating static site')
routes = pages.filter((page) -> page.path?).map((page) -> page.path)

#### Static site generation.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"coffee-script": "^1.9.3",
"commander": "^2.8.1",
"css-loader": "^0.22.0",
"debug": "^2.2.0",
"front-matter": "^1.0.0",
"fs-extra": "^0.19.0",
"glob": "^5.0.7",
Expand Down