add a --bundler option, for forcing rollup or webpack

This commit is contained in:
Rich Harris
2018-08-28 17:29:14 -04:00
parent 6e2383b66b
commit 85e25d6380
8 changed files with 45 additions and 11 deletions

View File

@@ -1,14 +1,18 @@
import { build as _build } from '../api/build';
import colors from 'kleur';
import * as colors from 'kleur';
import { locations } from '../config';
import validate_bundler from './utils/validate_bundler';
export function build(opts: { bundler?: string }) {
const bundler = validate_bundler(opts.bundler);
export function build() {
return new Promise((fulfil, reject) => {
try {
const emitter = _build({
dest: locations.dest(),
app: locations.app(),
routes: locations.routes(),
bundler,
webpack: 'webpack',
rollup: 'rollup'
});