mirror of
https://github.com/jxnblk/mdx-deck.git
synced 2024-11-25 15:50:39 +03:00
Merge branch 'master' of https://github.com/jxnblk/mdx-deck
This commit is contained in:
commit
81ad54f05c
@ -2,6 +2,7 @@ const path = require('path')
|
||||
const puppeteer = require('puppeteer')
|
||||
const mkdirp = require('mkdirp')
|
||||
const dev = require('mdx-deck/lib/dev')
|
||||
const findup = require('find-up')
|
||||
|
||||
module.exports = async opts => {
|
||||
const { type, outDir, outFile, port, width, height, sandbox } = opts
|
||||
@ -11,6 +12,13 @@ module.exports = async opts => {
|
||||
args.push('--no-sandbox', '--disable-setuid-sandbox')
|
||||
}
|
||||
|
||||
if (opts.webpack) {
|
||||
opts.webpack = require(path.resolve(opts.webpack))
|
||||
} else {
|
||||
const webpackConfig = findup.sync('webpack.config.js', { cwd: opts.dirname })
|
||||
if (webpackConfig) opts.webpack = require(webpackConfig)
|
||||
}
|
||||
|
||||
const server = await dev(opts)
|
||||
|
||||
const browser = await puppeteer.launch({ args })
|
||||
|
Loading…
Reference in New Issue
Block a user