@blunck/webpack-scripts v3.2.1
webpack-scripts
Opinionated webpack scripts
Installation
npm install --save-dev @blunck/webpack-scriptsAdd scripts to you package.json
{
"scripts": {
"start": "webpack-scripts start",
"build": "webpack-scripts build",
"profile": "webpack-scripts profile"
}
}Requirements
The webpack configuration expects the root of your project to contain a src directory with an index.js & index.html file:
src
index.js
index.html
package.json
.webpackrcConfiguration
Add a .webpackrc file to the root of your project. Following options are default:
{
"framework": "vanilla",
"host": "localhost",
"port": 3000,
"browser": "google chrome",
"copy": null,
"cssSourceMap": false,
"alias": null,
"zip": false,
"bugsnagApiKey": null,
"outputPath": "dist",
"publicPath": "/",
"sourceMaps": true,
"gzip": true
}frameworkJavascript framework that is used: "vanilla", "react" or "ng1"portPort to start development server atbrowserBrowser to open development server incopyArray of patterns to copy tooutputPath. See Copy Webpack Plugin for more infocssSourceMapEnable css / scss source maps (Causes style flash on initial load when running development server)aliasCreate aliases to import or require certain modules more easily. See Webpack Documentation for more infozipIf true create zip archive with build artifacts with following name:PROJECT_NAME-GIT_COMMIT_HASH.zipbugsnagApiKeyIf set upload source maps to bugsnagoutputPathThe output directory relative to th.webpackrcfilepublicPathPublic URL of the output directory when referenced in a browsersourceMapsSet tofalseto disable generation of js & css source mapsgzipSet tofalseto prevent js / css files from being gzipped
Scripts
Build
Build a production version of your application
npm run buildStart
Start a development server & re-compile / reload on changes. (HMR support for react)
npm run startProfile
Build a production version of your application & open a page with information about your bundle.
npm run profile6 years ago
6 years ago
6 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
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago