Skip to content

Commit

Permalink
Change 'serve' to 'develop' as better matches intent of command
Browse files Browse the repository at this point in the history
closes #88
  • Loading branch information
KyleAMathews committed Nov 22, 2015
1 parent 5409906 commit b331412
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -63,8 +63,8 @@ Contributions welcome!
directory for your Gatsby project and adds the minimal files
needed.
2. `cd my-test-gatsby-site`
3. `gatsby serve` — Gatsby will compile your code using Webpack and
serve the site at [localhost:8000](http://localhost:8000)
3. `gatsby develop` — Gatsby will start a hot-reloading development
server accessible at [localhost:8000](http://localhost:8000)
4. See the tutorial below for more.

### Gatsby Starters
Expand Down Expand Up @@ -98,7 +98,7 @@ include yours!
1. Install documentation site starter `gatsby new docs-site
gh:gatsbyjs/gatsby-starter-documentation`
2. type `cd docs-site`
2. type `gatsby serve`
2. type `gatsby develop`
3. Open site in browser at [localhost:8000](http://localhost:8000). Verify clicking on links works.
4. Try editing the site's config file `config.toml`.
Change the `siteTitle` key. The site's title should change shortly
Expand All @@ -114,7 +114,7 @@ include yours!
this. Ideally this new file would be hot reloaded like other changes
but I haven't figured out how to make this happen yet ([help
appreciated here](https://github.com/webpack/webpack/issues/1162)).
So to see your new page, restart `gatsby serve` and then refresh your
So to see your new page, restart `gatsby develop` and then refresh your
browser.
7. Build your site `gatsby build`. The site is built to the `/public`
directory. Serve the site by going into the public directory and
Expand Down
4 changes: 2 additions & 2 deletions bin/serve.coffee → bin/develop.coffee
Expand Up @@ -2,7 +2,7 @@ program = require 'commander'
path = require 'path'

packageJson = require '../package.json'
serve = require '../lib/utils/serve'
develop = require '../lib/utils/develop'

program
.version(packageJson.version)
Expand All @@ -17,4 +17,4 @@ directory = path.resolve(relativeDirectory)
program.directory = directory
program.relativeDirectory = relativeDirectory

serve(program)
develop(program)
2 changes: 1 addition & 1 deletion bin/gatsby-serve.js → bin/gatsby-develop.js
Expand Up @@ -2,4 +2,4 @@
require('babel/register');

require('coffee-script/register');
require('./serve');
require('./develop');
2 changes: 1 addition & 1 deletion bin/index.coffee
Expand Up @@ -5,7 +5,7 @@ packageJson = require '../package.json'

program
.version(packageJson.version)
.command('serve [directory]', 'Serve and hot-reload site')
.command('develop [directory]', 'Start hot-reloading development server')
.command('build [directory]', 'Do a production build of site')
.command('new [rootPath] [starter]', 'Create new Gatsby project in path [.].')
.parse(process.argv)
2 changes: 1 addition & 1 deletion lib/utils/serve.js → lib/utils/develop.js
Expand Up @@ -27,7 +27,7 @@ module.exports = function(program) {
// Perhaps should check if port is open.
var webpackPort = Math.round(Math.random() * 1000 + 1000);

var compilerConfig = webpackConfig(program, directory, 'serve', webpackPort);
var compilerConfig = webpackConfig(program, directory, 'develop', webpackPort);
var compiler = webpack(compilerConfig);

var HTMLPath;
Expand Down
10 changes: 5 additions & 5 deletions lib/utils/webpack.config.coffee
Expand Up @@ -19,7 +19,7 @@ babelExcludeTest = (absPath) ->
module.exports = (program, directory, stage, webpackPort = 1500, routes=[]) ->
output = ->
switch stage
when "serve"
when "develop"
path: directory
filename: 'bundle.js'
publicPath: "http://#{program.host}:#{webpackPort}/"
Expand All @@ -33,7 +33,7 @@ module.exports = (program, directory, stage, webpackPort = 1500, routes=[]) ->

entry = ->
switch stage
when "serve"
when "develop"
[
"#{__dirname}/../../node_modules/webpack-dev-server/client?#{program.host}:#{webpackPort}",
"#{__dirname}/../../node_modules/webpack/hot/only-dev-server",
Expand All @@ -50,7 +50,7 @@ module.exports = (program, directory, stage, webpackPort = 1500, routes=[]) ->

plugins = ->
switch stage
when "serve"
when "develop"
[
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
Expand Down Expand Up @@ -91,14 +91,14 @@ module.exports = (program, directory, stage, webpackPort = 1500, routes=[]) ->

devtool = ->
switch stage
when "serve", "static"
when "develop", "static"
"eval"
when "production"
"source-map"

module = ->
switch stage
when "serve"
when "develop"
loaders: [
{ test: /\.css$/, loaders: ['style', 'css']},
{ test: /\.cjsx$/, loaders: ['react-hot', 'coffee', 'cjsx']},
Expand Down

0 comments on commit b331412

Please sign in to comment.