-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nuxt-build and nuxt-start, build:false and dev option
- Loading branch information
Showing
20 changed files
with
343 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env node | ||
|
||
const fs = require('fs') | ||
const Nuxt = require('../') | ||
const { resolve } = require('path') | ||
|
||
const rootDir = resolve(process.argv.slice(2)[0] || '.') | ||
const nuxtConfigFile = resolve(rootDir, 'nuxt.config.js') | ||
let options = {} | ||
if (fs.existsSync(nuxtConfigFile)) { | ||
options = require(nuxtConfigFile) | ||
} | ||
if (typeof options.rootDir !== 'string') { | ||
options.rootDir = rootDir | ||
} | ||
|
||
options.dev = false // Create production build when calling `nuxt build` | ||
|
||
console.log('[nuxt] Building...') | ||
new Nuxt(options) | ||
.then((nuxt) => { | ||
console.log('[nuxt] Building done') | ||
}) | ||
.catch((err) => { | ||
console.error(err) | ||
process.exit() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env node | ||
|
||
const fs = require('fs') | ||
const Nuxt = require('../') | ||
const Server = require('../lib/server') | ||
const { resolve } = require('path') | ||
|
||
const rootDir = resolve(process.argv.slice(2)[0] || '.') | ||
const nuxtConfigFile = resolve(rootDir, 'nuxt.config.js') | ||
let options = {} | ||
if (fs.existsSync(nuxtConfigFile)) { | ||
options = require(nuxtConfigFile) | ||
} | ||
if (typeof options.rootDir !== 'string') { | ||
options.rootDir = rootDir | ||
} | ||
|
||
new Nuxt(options) | ||
.then((nuxt) => { | ||
new Server(nuxt) | ||
.listen(process.env.PORT, process.env.HOST) | ||
}) | ||
.catch((err) => { | ||
console.error(err) | ||
process.exit() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.