Commit d2149da5 authored by Felix-Antoine Paradis's avatar Felix-Antoine Paradis Committed by Arunoda Susiripala

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

parent 3a9c4191
...@@ -7,9 +7,9 @@ import webpack from './webpack' ...@@ -7,9 +7,9 @@ import webpack from './webpack'
import replaceCurrentBuild from './replace' import replaceCurrentBuild from './replace'
import md5File from 'md5-file/promise' 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 buildDir = join(tmpdir(), uuid.v4())
const compiler = await webpack(dir, { buildDir }) const compiler = await webpack(dir, { buildDir, conf })
try { try {
await runCompiler(compiler) await runCompiler(compiler)
......
...@@ -27,9 +27,9 @@ const interpolateNames = new Map(defaultPages.map((p) => { ...@@ -27,9 +27,9 @@ const interpolateNames = new Map(defaultPages.map((p) => {
const relativeResolve = rootModuleRelativePath(require) 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) dir = resolve(dir)
const config = getConfig(dir) const config = getConfig(dir, conf)
const defaultEntries = dev ? [ const defaultEntries = dev ? [
join(__dirname, '..', '..', 'client', 'webpack-hot-middleware-client'), join(__dirname, '..', '..', 'client', 'webpack-hot-middleware-client'),
join(__dirname, '..', '..', 'client', 'on-demand-entries-client') join(__dirname, '..', '..', 'client', 'on-demand-entries-client')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment