React Webpack
Commands for building React Frontend applications using webpack.
INFO
extends webpack-scripts
Usage
Adding it to an existing project
# install the react-webpack-scripts and cli packages
npm install @pota/react-webpack-scripts @pota/cli --save-dev
# configure the cli package to use react-webpack-scripts
npm pkg set pota="@pota/react-webpack-scripts"
Commands
build
Create a production bundle.
npx pota build
Option | Type | Default | Description |
---|---|---|---|
analyze | {Boolean} | false | When enabled, will open a bundle report after bundling. |
cache | {Boolean} | true | Toggles webpack's caching behavior. |
image-compression | {Boolean} | true | Toggles image compression. |
debug | {Boolean} | false | Sets NODE_ENV to 'development'. |
watch | {Boolean} | false | Run build and watch for changes. |
output | {String} | ./dist | The build output directory. |
source-map | {false| 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} | true | When disabled, will ignore type related errors. |
versioning | {Boolean} | false | When enabled, will copy assets in ./static to a versioned directory in the output (e.g. build/version/v2/static/... ). |
profile | {Boolean} | false | Toggles support for the React Devtools in production. |
dev
Start the development server.
npx pota dev
Option | Type | Default | Description |
---|---|---|---|
cache | {Boolean} | true | Toggle webpack's caching behavior. |
https | {Boolean} | false | Run the development server with HTTPS. |
open | {Boolean} | true | Allows to configure dev server to open the browser after the server has been started. |
port | {Number} | 2001 | Allows configuring the port. |
image-compression | {Boolean} | true | Toggles image compression. |
prod | {Boolean} | false | Sets NODE_ENV to 'production'. |
source-map | {false| 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} | true | Toggles checking for type related errors. |
Config Reference [WIP]
see webpack-scripts