fix(core): update

This commit is contained in:
2020-07-07 18:34:50 +00:00
parent 9abb00261d
commit c7d61bec0b
3 changed files with 27 additions and 8 deletions

View File

@ -25,6 +25,9 @@ export class Parcel {
public options: plugins.parcel.ParcelOptions;
public entryFiles: string | string[] = plugins.path.join(process.cwd(), './html/index.html');
/**
* builds and serves
*/
public async start() {
const bundler = new plugins.parcel(this.entryFiles, this.options);
@ -33,6 +36,17 @@ export class Parcel {
const bundle = await bundler.serve(3002);
}
/**
* just builds
*/
public async build() {
const bundler = new plugins.parcel(this.entryFiles, this.options);
// Run the bundler, this returns the main bundle
// Use the events if you're using watch mode as this promise will only trigger once and not for every rebuild
const bundle = await bundler.bundle();
}
constructor(fromArg: string | string[], outputDirArg: string, outputFileArg: string) {
this.entryFiles = fromArg;
this.options = {