Webpack compile api
npm install @component-controls/webpack-compile- Overview
- Installation
- Usage
- API
- compile
- watch
Standalone webpack compile/watch API for @component-controls.
``bash`
$ npm install @component-controls/webpack-compile --save-dev
import { compile } from '@component-controls/webpack-compile';
...
const { store } = await compile({
presets: ['react', 'react-docgen-typescript'],
configPath: path.resolve(__dirname, 'fixtures', 'examples'),
});
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\_ | : encodeHTMLBuildProps
webpack
: Configuration \| WebpackConfigFnfinalWebpack: Configuration \| WebpackConfigFnpresets: RuleType\[]configPath: stringdistFolder: stringbundleName: stringstaticFolder: stringcssFileName: stringlogOptions: Partial<LogOptions>mode: "none" \| "development" \| "production"loadersencodeHTML\
at\: function (index\: T
) => \| undefinedmodule: stringident: stringloader: stringoptions: string \| type | configuration properties for compile and run |callback
| | function (results\bundleName\: stats\: store\: ) => void \| Promise | callback function to monitor new documents/deleted documents |returns
| | Promise<CompileResults> | |
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\_ | : encodeHTMLWatchProps
webpackwatchOptions
aggregateTimeout
: numberfollowSymlinks: booleanignored: string \| RegExp \| string\[]poll: number \| booleanstdin: boolean: Configuration \| WebpackConfigFnfinalWebpack: Configuration \| WebpackConfigFnpresets: RuleType\[]configPath: stringdistFolder: stringbundleName: stringstaticFolder: stringcssFileName: stringlogOptions: Partial<LogOptions>mode: "none" \| "development" \| "production"loadersencodeHTML\
at\: function (index\: T
) => \| undefinedmodule: string | adds webpack WatchOptions to the Compiler options |callback
| | function (results\bundleName\: stats\: store\: ) => void \| Promise | callback function to monitor new documents/deleted documents |returns
| | Promise<CompileResults`> | |