mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-07 09:22:27 +00:00
internals: improve options module (#1392)
This commit is contained in:
parent
9db110002a
commit
db19b50a02
@ -3,7 +3,11 @@ import { join, resolve } from 'path'
|
||||
import { existsSync } from 'fs'
|
||||
import { isUrl, isPureObject } from 'utils'
|
||||
|
||||
export default function Options (_options) {
|
||||
const Options = {}
|
||||
|
||||
export default Options
|
||||
|
||||
Options.from = function (_options) {
|
||||
// Clone options to prevent unwanted side-effects
|
||||
const options = Object.assign({}, _options)
|
||||
|
||||
|
@ -15,7 +15,7 @@ export default class Nuxt extends Tapable {
|
||||
constructor (_options = {}) {
|
||||
super()
|
||||
|
||||
this.options = Options(_options)
|
||||
this.options = Options.from(_options)
|
||||
|
||||
// Paths for resolving requires from `rootDir`
|
||||
this.nodeModulePaths = Module._nodeModulePaths(this.options.rootDir)
|
||||
|
Loading…
Reference in New Issue
Block a user