emit legacy build

This commit is contained in:
Rich Harris
2018-08-30 22:58:07 -04:00
parent afcd643035
commit e00b315dec
4 changed files with 45 additions and 8 deletions

View File

@@ -4,15 +4,20 @@ import { locations } from '../config';
import validate_bundler from './utils/validate_bundler';
import { repeat } from '../utils';
export function build(opts: { bundler?: string }) {
export function build(opts: { bundler?: string, legacy?: boolean }) {
const bundler = validate_bundler(opts.bundler);
if (opts.legacy && bundler === 'webpack') {
throw new Error(`Legacy builds are not supported for projects using webpack`);
}
return new Promise((fulfil, reject) => {
try {
const emitter = _build({
dest: locations.dest(),
app: locations.app(),
routes: locations.routes(),
legacy: opts.legacy,
bundler,
webpack: 'webpack',
rollup: 'rollup'