webpack-go v0.0.19
webpack-go
install
npm install --save-dev webpack-go
usage
./node_modules/.bin/webpack-go <action>
Getting started
In few words - webpack-go generate webpack config for you. By default it consumes next project structure:
\
|--src/
|--main.tsx
|--index.html
|--
index.html is your entrypoint. Compiled chunks will be included there into \<body> tag.
start/build
./node_modules/.bin/webpack-go start
./node_modules/.bin/webpack-go build
Both actions has the same options
Examples
Build react, react-dom and redux to separated chunk:
webpack-go start --vendor react, react-dom, redux
Set main module:
webpack-go start --main my-main
Start dev-server on custom port:
webpack-go start --port 8090
Options
Options could be provided via cli arguments or in package.json in "webpack-go" section.
cwd:string | default: process.cwd()
! this options couldn't be set through package.json.
Working dir. You could override you working dir to init or run project located not in dir where you execute the code.
dist:string | default: "dist"
Dir where compiled code will appear.
src:string | default: "src"
Source dir.
main:string | default: "main"
Main module.
vendor:string[] | default: []
Set of modules to be separated 'vendor' chunk.
modules:string[] | default: []
Set of modules to be included in multi-module entrypoint (entrypoint option should set to true.
entrypoint:boolean | default: false
Do generate multi-module entrypoint.
html:string | default: "src/index.html"
Path to project html file what all assets will be included to (related to cwd).
poll:boolean/number | default: false
This parameter could be used if you work with the filesystem where you can't watch file changes (e.g. if you run your app with a virtual machine but write code on a host system).
port:number | default: 3030
Dev-server port.
no-ts-config:boolean | default: false
Do not copy tsconfig in working dir. You should create it manually.
no-postcss-config:boolean | default: false
Do not copy postcss in working dir.
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago