Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

I'm building a wrapper module around next.js and was looking for an easy way to call build and export where I can pass the config in much the same was as the server api can be initiated.

Judging by nexteins implementation this is the currently the way to interact with these apis.

it'd be great if we had either of the following:

const nextApp = next({ dev, conf })

// server
await nextApp.prepare()

// build / export
await nextApp.build()
await nextApp.export()

Alternatively

const build = require('next/server/build')
const export = require('next/server/export')

await build({ dev, conf })
...

Thoughts?

Issue 2:
[x ] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

I am converting a React project to using Next.js. My project uses nconf and this causes irreconcilable dependency failures during page compilation.

Current Behavior

Any component/file that imports nconf results in the following error. This error also occurs if you explicitly add the child_process and fs dependencies to the project.

nd:

es/os-locale/index.js

b/nconf/common.js, ./node_modules/nconf/lib/nconf/stores/file.js and 2 others

pm install --save child_process fs

found: Error: Can't resolve 'child_process' in '\node_modules\os-locale'

odules\webpack\lib\Compilation.js:276:40)

ebpack\lib\NormalModuleFactory.js:235:20)

webpack\lib\NormalModuleFactory.js:60:20)

_modules\webpack\lib\NormalModuleFactory.js:127:20)

de_modules\async\dist\async.js:3874:9

de_modules\async\dist\async.js:473:16

modules\webpack\node_modules\async\dist\async.js:1048:13)

de_modules\async\dist\async.js:958:16

de_modules\async\dist\async.js:3871:13

(\node_modules\webpack\lib\NormalModuleFactory.js:119:22)

nhanced-resolve\lib\Resolver.js:65:10)

\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19)

enhanced-resolve\lib\Resolver.js:158:4)

ules\enhanced-resolve\lib\Resolver.js:146:3)

\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19)

ble\lib\Tapable.js:252:11)

t find "store" in either the context or props of "Connect(MainPageThumbs)". Either wrap the root component in a , or explicitly pass "store" as a prop to "Connect(MainPageThumbs)".

\invariant\invariant.js:40:15)

es\react-redux\lib\components\connectAdvanced.js:134:33)

les\react-dom\cjs\react-dom-server.node.development.js:2082:14)

eact-dom\cjs\react-dom-server.node.development.js:2048:5)

ender (\node_modules\react-dom\cjs\react-dom-server.node.development.js:2333:22)

ead (\node_modules\react-dom\cjs\react-dom-server.node.development.js:2307:19)

dules\react-dom\cjs\react-dom-server.node.development.js:2679:25)

s\next\dist\server\render.js:277:26)

(\node_modules\next\dist\server\document.js:67:25)

next\dist\lib\utils.js:111:30)

regenerator-runtime\runtime.js:62:40)

voke] (\node_modules\regenerator-runtime\runtime.js:296:22)

nymous function) [as next] (\node_modules\regenerator-runtime\runtime.js:114:21)

el\runtime\helpers\asyncToGenerator.js:12:30)

bel\runtime\helpers\asyncToGenerator.js:27:9)

time\helpers\asyncToGenerator.js:34:7

found: Error: Can't resolve 'child_process' in '\node_modules\os-locale'

odules\webpack\lib\Compilation.js:276:40)

ebpack\lib\NormalModuleFactory.js:235:20)

webpack\lib\NormalModuleFactory.js:60:20)

_modules\webpack\lib\NormalModuleFactory.js:127:20)

de_modules\async\dist\async.js:3874:9

de_modules\async\dist\async.js:473:16

modules\webpack\node_modules\async\dist\async.js:1048:13)

de_modules\async\dist\async.js:958:16

de_modules\async\dist\async.js:3871:13

(\node_modules\webpack\lib\NormalModuleFactory.js:119:22)

nhanced-resolve\lib\Resolver.js:65:10)

\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19)

enhanced-resolve\lib\Resolver.js:158:4)

ules\enhanced-resolve\lib\Resolver.js:146:3)

\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19)

ble\lib\Tapable.js:252:11)

Steps to Reproduce (for bugs)

Add 'nconf' module to the project

yarn add nconf

Import nconf into any component

import nconf from 'nconf'

Use nconf in your code

var conf = nconf.argv().env();

Run next app

yarn dev

Alternatively, I have posted an example project on GitHub that can be cloned via

https://github.com/caskater4/nextnconf.git

Context

This is a blocking issue attempting to convert an existing React app to using server-side rendering with Next.

Your Environment

Tech
Version

next
6.0.1

node
8.2.1

OS
Windows 10

browser
Chrome

etc
nconf: 0.10.0