Skip to content
This repository was archived by the owner on Sep 12, 2019. It is now read-only.

Some small UX tweaks #23

Merged
merged 2 commits into from
Mar 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/commands/dev/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ async function startProxy(settings, addonUrls) {
function startDevServer(settings, log, error) {
if (settings.noCmd) {
const StaticServer = require('static-dev-server')
if (!settings.dist) {
log(
'Unable to determine public folder for the dev server.\nSetup a netlify.toml file with a [dev] section to specify your dev server settings.'
)
process.exit(1)
}

const server = new StaticServer({
rootPath: settings.dist,
name: 'netlify-dev',
Expand Down Expand Up @@ -115,7 +122,9 @@ class DevCommand extends Command {
const {flags, args} = this.parse(DevCommand)
const {api, site, config} = this.netlify
const functionsDir =
flags.functions || (config.build && config.build.functions)
flags.functions ||
(config.dev && config.dev.functions) ||
(config.build && config.build.functions)
const addonUrls = {}
if (site.id && !flags.offline) {
const accessToken = await this.authenticate()
Expand Down Expand Up @@ -145,11 +154,14 @@ class DevCommand extends Command {
let settings = serverSettings(config.dev)
if (!(settings && settings.cmd)) {
this.log('No dev server detected, using simple static server')
const dist =
(config.dev && config.dev.publish) ||
(config.build && config.build.publish)
settings = {
noCmd: true,
port: 8888,
proxyPort: 3999,
dist: config.build && config.build.publish,
dist,
}
}
startDevServer(settings, this.log, this.error)
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy