Table of contents
Overview
Standalone webpack compile/watch API for @component-controls.
Installation
$ npm install @component-controls/webpack-compile --save-dev
Usage
import { compile } from '@component-controls/webpack-compile';
...
const { store } = await compile({
presets: ['react', 'react-docgen-typescript'],
configPath: path.resolve(__dirname, 'fixtures', 'examples'),
});
API
compile
async function
compile the stories with webpack returns the stories store object
defined in @component-controls/webpack-compile/core/webpack-compile/src/index.ts
parameters
Name | Type | Description |
---|---|---|
anonymous* |
|
configuration properties for compile and run |
callback |
function (
|
callback function to monitor new documents/deleted documents |
returns |
Promise <CompileResults > |
watch
async function
compile the stories with webpack and launch watching for changes returns the stories store object
defined in @component-controls/webpack-compile/core/webpack-compile/src/index.ts
parameters
Name | Type | Description |
---|---|---|
anonymous* |
|
adds webpack WatchOptions to the Compiler options |
callback |
function (
|
callback function to monitor new documents/deleted documents |
returns |
Promise <CompileResults > |