Preact-cli: Expose commands and node modules

Created on 2 Mar 2018  路  1Comment  路  Source: preactjs/preact-cli

A lot of testing tools need to spin up servers, build code in travis like sandboxes etc.

It might be helpful to expose our commands as node modules so they can be required and executed from inside js files.

example usecase

  • Visual diff testing with pupeteer
enhancement stale

Most helpful comment

strawman:

import { build, watch } from 'preact-cli';

build(dir, options).then( ... )

watch(dir, { ...options, onBuild }).then( ... )

it would also be awesome to add an option to use an existing webpack virtual FS so people could compile production builds to an in-memory filesystem for testing purposes.

>All comments

strawman:

import { build, watch } from 'preact-cli';

build(dir, options).then( ... )

watch(dir, { ...options, onBuild }).then( ... )

it would also be awesome to add an option to use an existing webpack virtual FS so people could compile production builds to an in-memory filesystem for testing purposes.

Was this page helpful?
0 / 5 - 0 ratings