0.2.1 • Published 5 years ago

carlo-webpack v0.2.1

Weekly downloads
15
License
-
Repository
github
Last release
5 years ago

carlo-webpack

Simple Node API for Carlo + Webpack

* Requires Node >= v10.12.0

Install

npm i carlo-webpack

Usage

const carloWebpack = require('carlo-webpack')
const config = require('./webpack.config.js')
const { runDevServer, build, launch } = await carloWebpack({
  webpack: { config },
})

await build() // OR
await runDevServer()
// then
const app = await launch();

API

carloWebpack(opts)
  • opts

    • dev [boolean] Whether to run WebpackDevServer (with Hot Reload) or build (or use previously built) bundle

    • cache [boolean=true] Use previously built bundle

    • webpack

      • config Webpack config (webpack.config.js)
      • devServer Options passed to WebpackDevServer
      • watcher Watcher function called every time WebpackDevServer re-compiles
    • html [object] Options for html-webpack-plugin

    • carlo

      • launch [object] Options passed to carlo.launch

      • load

        • uri [string] URI for Carlo's app.load(uri). Default = automatically chosen
        • params [array] Params for Carlo's app.load(uri, ...params)