@component-controls/webpack-compile
v4.0.3
Published
Webpack compile api
Downloads
83
Readme
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* | BuildProps
webpack
: Configuration
| WebpackConfigFn
finalWebpack
: Configuration
| WebpackConfigFn
presets
: RuleType
[]configPath
: string
distFolder
: string
bundleName
: string
staticFolder
: string
cssFileName
: string
logOptions
: Partial
<LogOptions
>mode
: "none"
| "development"
| "production"
loaders
encodeHTML
*: encodeHTMLat
*: function (index
*: ) => T
| undefined
module
: string
ident
: string
loader
: string
options
: 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
> | |
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* | WatchProps
watchOptions
aggregateTimeout
: number
followSymlinks
: boolean
ignored
: string
| RegExp
| string
[]poll
: number
| boolean
stdin
: boolean
webpack
: Configuration
| WebpackConfigFn
finalWebpack
: Configuration
| WebpackConfigFn
presets
: RuleType
[]configPath
: string
distFolder
: string
bundleName
: string
staticFolder
: string
cssFileName
: string
logOptions
: Partial
<LogOptions
>mode
: "none"
| "development"
| "production"
loaders
encodeHTML
*: encodeHTMLat
*: function (index
*: ) => T
| undefined
module
: 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
> | |