mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-13 03:25:24 +00:00
emit legacy build
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user