Muban Webpack

Commands for building Muban Frontend applications using webpack.

INFO

extends webpack-scripts

Usage

Adding it to an existing project

# install the muban-webpack-scripts and cli packages
npm install @pota/muban-webpack-scripts @pota/cli --save-dev

# configure the cli package to use muban-webpack-scripts
npm pkg set pota="@pota/muban-webpack-scripts"

TIP

Want to extend this scripts package?

Take a look at the extending section of @pota/cli.

Commands

build

Create a production bundle.

npx pota build
OptionTypeDefaultDescription
analyze{Boolean}falseWhen enabled, will open a bundle report after bundling.
cache{Boolean}trueToggles webpack's caching behavior.
image-compression{Boolean}trueToggles image compression.
debug{Boolean}falseSets NODE_ENV to 'development'.
watch{Boolean}falseRun build and watch for changes.
output{String}dist/siteThe build output directory.
source-map{false or'devtool'}
hidden-source-map (production), cheap-source-map (development)
Sets the style of source-map, for enhanced debugging. Disable or use faster options in you are having out of memory or other performance issues.
public-path{String}/The location of static assets on your production server.
typecheck{Boolean}trueWhen disabled, will ignore type related errors.
versioning{Boolean}falseWhen enabled, will copy assets in ./static to a versioned directory in the output (e.g. build/version/v2/static/...).
mock-api{Boolean}falseToggles support for building API mocks.
preview{Boolean}falseToggles support for building the preview

dev

Start the development server.

npx pota dev
OptionTypeDefaultDescription
cache{Boolean}trueToggle webpack's caching behavior.
https{Boolean}falseRun the development server with HTTPS.
open{Boolean}trueAllows to configure dev server to open the browser after the server has been started.
port{Number}9000Allows configuring the port.
image-compression{Boolean}trueToggles image compression.
prod{Boolean}falseSets NODE_ENV to 'production'.
source-map{false or'devtool'}hidden-source-map (production), cheap-source-map (development)Sets the style of source-map, for enhanced debugging. Disable or use faster options in you are having out of memory or other performance issues.
typecheck{Boolean}trueToggles checking for type related errors.
mock-api{Boolean}falseToggles support for building API mocks.

copy-twig

Copy twig files to the dist folder.

npx pota copy-twig
OptionTypeDefaultDescription
include-server{Boolean}falseIncludes the configuration files for running the Twig Server.

Config Reference [WIP]

see webpack-scripts