1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Add the ability to pass next configuration to production builds (#2345)

This commit is contained in:
Felix-Antoine Paradis 2017-06-22 23:48:06 -04:00 committed by Arunoda Susiripala
parent 3a9c419160
commit d2149da54d
2 changed files with 4 additions and 4 deletions

View file

@ -7,9 +7,9 @@ import webpack from './webpack'
import replaceCurrentBuild from './replace'
import md5File from 'md5-file/promise'
export default async function build (dir) {
export default async function build (dir, conf = null) {
const buildDir = join(tmpdir(), uuid.v4())
const compiler = await webpack(dir, { buildDir })
const compiler = await webpack(dir, { buildDir, conf })
try {
await runCompiler(compiler)

View file

@ -27,9 +27,9 @@ const interpolateNames = new Map(defaultPages.map((p) => {
const relativeResolve = rootModuleRelativePath(require)
export default async function createCompiler (dir, { dev = false, quiet = false, buildDir } = {}) {
export default async function createCompiler (dir, { dev = false, quiet = false, buildDir, conf = null } = {}) {
dir = resolve(dir)
const config = getConfig(dir)
const config = getConfig(dir, conf)
const defaultEntries = dev ? [
join(__dirname, '..', '..', 'client', 'webpack-hot-middleware-client'),
join(__dirname, '..', '..', 'client', 'on-demand-entries-client')