mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-18 14:41:25 +00:00
feat: support global command-line build and start (#3647)
With this pr, user can install nuxt globally, then start or build simple repos without npm /yarn install: ```bash npm i nuxt-edge -g nuxt dev/build/start ```
This commit is contained in:
parent
24daeba035
commit
3b5a4709e8
@ -154,6 +154,7 @@ export default class Renderer {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const hasModules = fs.existsSync(path.resolve(this.options.rootDir, 'node_modules'))
|
||||||
// Create bundle renderer for SSR
|
// Create bundle renderer for SSR
|
||||||
this.bundleRenderer = createBundleRenderer(
|
this.bundleRenderer = createBundleRenderer(
|
||||||
this.resources.serverBundle,
|
this.resources.serverBundle,
|
||||||
@ -161,7 +162,8 @@ export default class Renderer {
|
|||||||
{
|
{
|
||||||
clientManifest: this.resources.clientManifest,
|
clientManifest: this.resources.clientManifest,
|
||||||
runInNewContext: false,
|
runInNewContext: false,
|
||||||
basedir: this.options.rootDir
|
// for globally installed nuxt command, search dependencies in global dir
|
||||||
|
basedir: hasModules ? this.options.rootDir : __dirname
|
||||||
},
|
},
|
||||||
this.options.render.bundleRenderer
|
this.options.render.bundleRenderer
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user