@component-controls/webpack-compile
TypeScript icon, indicating that this package has built-in type declarations

4.0.3 • Public • Published

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*: encodeHTML
at*: 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*: encodeHTML
at*: 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>

Readme

Keywords

none

Package Sidebar

Install

npm i @component-controls/webpack-compile

Weekly Downloads

183

Version

4.0.3

License

MIT

Unpacked Size

89.6 kB

Total Files

20

Last publish

Collaborators

  • atanasster