Skip to content

Commit 960ba50

Browse files
author
Bulfair, Matt
committed
update to readme
1 parent 4ba4903 commit 960ba50

File tree

1 file changed

+42
-25
lines changed

1 file changed

+42
-25
lines changed

readme.md

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
11
[![Apache V2 License](http://img.shields.io/badge/license-Apache%20V2-blue.svg)](https://github.com/Comcast/patternlab-edition-node-webpack/blob/master/LICENSE)
22

3-
43
# Pattern Lab Node - Webpack Edition
4+
55
The webpack wrapper around [Pattern Lab Node Core](https://github.com/pattern-lab/patternlab-node) providing tasks to interact with the core library and move supporting frontend assets.
66

77
## Packaged Components
88

99
The webpack edition comes with the following components:
1010

11-
* `patternlab-node`: [GitHub](https://github.com/pattern-lab/patternlab-node), [npm](https://www.npmjs.com/package/patternlab-node)
12-
* `patternengine-node-mustache`: [GitHub](https://github.com/pattern-lab/patternengine-node-mustache), [npm](https://www.npmjs.com/package/patternengine-node-mustache)
13-
* `pattern-lab/styleguidekit-assets-default`: [GitHub](https://github.com/pattern-lab/styleguidekit-assets-default)
14-
* `pattern-lab/styleguidekit-mustache-default`: [GitHub](https://github.com/pattern-lab/styleguidekit-mustache-default)
11+
- `patternlab-node`: [GitHub](https://github.com/pattern-lab/patternlab-node), [npm](https://www.npmjs.com/package/patternlab-node)
12+
- `patternengine-node-mustache`: [GitHub](https://github.com/pattern-lab/patternengine-node-mustache), [npm](https://www.npmjs.com/package/patternengine-node-mustache)
13+
- `pattern-lab/styleguidekit-assets-default`: [GitHub](https://github.com/pattern-lab/styleguidekit-assets-default)
14+
- `pattern-lab/styleguidekit-mustache-default`: [GitHub](https://github.com/pattern-lab/styleguidekit-mustache-default)
1515

1616
## Prerequisites
1717

1818
The Pattern Lab Node - webpack edition uses [Node](https://nodejs.org/en/) for core processing, [npm](https://www.npmjs.com/) to manage project dependencies, and [webpack.io](https://webpack.github.io/) to run tasks and interface with the core library. Node version 4 or higher suffices. You can follow the directions for [installing Node](https://nodejs.org/en/download/) on the Node website if you haven't done so already. Installation of Node will include npm.
1919

2020
## Quickstart Guide
21+
2122
_Note: You must have all of the prerequisites first_
2223

23-
1. Download the `.zip` or fork this repository, then clone it locally.
24+
1. Download the `.zip` or fork this repository, then clone it locally.
2425
> `git clone [email protected]:YOURGROUP/patternlab-edition-node-webpack.git`
25-
1. In a terminal window, navigate to the downloaded directory
26+
1. In a terminal window, navigate to the downloaded directory
2627
> `cd path/to/patternlab-edition-node-webpack`
27-
1. To populate Patternlab with sample data, install a starter kit, there are many [starterkits](https://github.com/pattern-lab?utf8=%E2%9C%93&q=starterkit&type=&language=) choose from
28+
1. To populate Patternlab with sample data, install a starter kit, there are many [starterkits](https://github.com/pattern-lab?utf8=%E2%9C%93&q=starterkit&type=&language=) choose from
2829
> `npm install starterkit-mustache-demo`
29-
1. Generate sample files
30+
1. Generate sample files
3031
> `npm run patternlab:loadstarterkit --kit=starterkit-mustache-demo`
31-
1. Show Patternlab in a Webbrowser
32+
1. Show Patternlab in a Webbrowser
3233
> `npm run patternlab:serve`
3334
3435
## Installing
@@ -37,24 +38,24 @@ _Note: You must have all of the prerequisites first_
3738

3839
### What's Included
3940

40-
The pre-built project comes with the [Base Starterkit for Mustache](https://github.com/pattern-lab/starterkit-mustache-base) installed by default.
41+
The pre-built project comes with the [Base Starterkit for Mustache](https://github.com/pattern-lab/starterkit-mustache-base) installed by default.
4142

4243
**Please note:** Pattern Lab Node uses [npm](https://www.npmjs.com/) to manage project dependencies. To upgrade the webpack edition or to install plug-ins you'll need to be familiar with npm.
4344

4445
### Use npm
4546

4647
`npm` is a dependency management and package system which can pull in all of the webpack editions's dependencies for you. To accomplish this:
4748

48-
* download or `git clone` this repository to an install location.
49+
- download or `git clone` this repository to an install location.
4950

50-
* run the following
51+
- run the following
5152

5253
```
5354
cd install/location
5455
npm install
5556
```
5657
57-
Running `npm install` from a directory containing a `package.json` file will download all dependencies defined within. The `package-lock.json` file is automatically managaged everytime you add/remove/upgrade a dependency.
58+
Running `npm install` from a directory containing a `package.json` file will download all dependencies defined within. The `package-lock.json` file is automatically managaged everytime you add/remove/upgrade a dependency.
5859
5960
#### Install the Webpack Edition of Pattern Lab Node as a Dependency
6061
@@ -91,7 +92,7 @@ To generate the front-end for Pattern Lab type:
9192
9293
### Watch for changes and re-generate Pattern Lab
9394
94-
To watch for changes, re-generate the front-end, and server it via a BrowserSync server, type:
95+
To watch for changes, re-generate the front-end, and server it via a BrowserSync server, type:
9596
9697
npm run patternlab:serve
9798
@@ -109,35 +110,51 @@ To install a specific StarterKit from GitHub type:
109110
110111
Unlike the other editions, there were a few options added just for this edition that allow for easier upgrading, and better flexibility.
111112
112-
#### Setting Dev Server Settings
113-
You can set the url and port number in the configuration for
113+
#### Setting Webpack Dev Server
114114
115-
"server": {
115+
You can set several options to configure your dev server. You can also in the CLI pass any option on demand.
116+
117+
```javascript
118+
"webpackDevServer": {
116119
"url": "http://localhost",
117-
"port": 3000
120+
"port": 3000,
121+
"watchContentBase": true,
122+
"watchOptions": {
123+
"aggregateTimeout": 500,
124+
"ignored": [],
125+
"info-verbosity": "verbose"
126+
}
118127
},
128+
```
119129

120130
#### Setting the Webpack Merge Options
131+
121132
In this edition, it's important to make the configuration for webpack something very easy to update, and very easy to modify. The current setting for webpack merge are described [here.](https://github.com/Comcast/patternlab-edition-node-webpack/blob/master/source/_app/readme.md)
122133

123134
You can change how it merges by changing this object in `patternlab-config.json`:
124-
135+
136+
```javascript
125137
"webpackMerge": {
126-
"entry":"replace"
138+
"entry": "replace"
127139
},
140+
```
128141

129142
By default merge does a `append` if that option works for you only set which webpack configuration you want to change. The merge setting is: `smartStrategy` which is documented over on this [page.](https://www.npmjs.com/package/webpack-merge#mergesmartstrategy-key-prependappendreplaceconfiguration--configuration)
130143

131144
### Licenses
145+
* [babel-cli](https://github.com/babel/babel/blob/master/LICENSE) - MIT
132146
* [babel-core](https://github.com/babel/babel/blob/master/LICENSE) - MIT
133-
* [babel-loader](https://github.com/babel/babel-loader/blob/master/LICENSE) -MIT,
147+
* [babel-polyfill](https://github.com/babel/babel-loader/blob/master/LICENSE) -MIT
148+
* [babel-loader](https://github.com/babel/babel-loader/blob/master/LICENSE) -MIT
134149
* [babel-preset-env](https://github.com/babel/babel/blob/master/LICENSE) - MIT
150+
* [babel-register](https://github.com/babel/babel-loader/blob/master/LICENSE) -MIT
135151
* [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin/blob/master/LICENSE) - MIT
136152
* [event-hooks-webpack-plugin](https://github.com/cascornelissen/event-hooks-webpack-plugin/blob/master/LICENSE.md) - MIT
137153
* [globby](https://github.com/sindresorhus/globby/blob/master/license) - MIT
138154
* [patternlab-node](https://github.com/pattern-lab/patternlab-node/blob/master/LICENSE) - MIT
139155
* [styleguidekit-assets-default](https://github.com/pattern-lab/styleguidekit-assets-default/blob/master/LICENSE) - MIT
140156
* [styleguidekit-mustache-default](https://github.com/pattern-lab/styleguidekit-mustache-default/blob/master/LICENSE) - MIT
157+
* [uglifyjs-webpack-plugin](https://github.com/webpack-contrib/uglifyjs-webpack-plugin/blob/master/LICENSE) - MIT
141158
* [webpack](https://github.com/webpack/webpack/blob/master/LICENSE) - MIT
142159
* [webpack-config-utils](https://github.com/kentcdodds/webpack-config-utils/blob/master/LICENSE) - MIT
143160
* [webpack-dev-server](https://github.com/webpack/webpack-dev-server/blob/master/LICENSE) - MIT
@@ -147,6 +164,6 @@ By default merge does a `append` if that option works for you only set which web
147164

148165
| | | |
149166
----------- | :-------------- | :-- |
150-
| ![@Josh68](https://avatars2.githubusercontent.com/u/771447?s=460&v=4)| **Josh Schneider** | [GitHub](https://github.com/Josh68)
151-
| ![@paintedbicycle](https://avatars3.githubusercontent.com/u/371114?s=75&v=4)| **Paul Wright** | [Website](https://paintedbicycle.com)
152-
| ![@rgualberto](https://avatars3.githubusercontent.com/u/5126167?v=4&s=75) | **Rodrigo Gualberto** | [GitHub](https://github.com/rgualberto)
167+
| ![@Josh68](https://avatars2.githubusercontent.com/u/771447?s=75&v=4)| **Josh Schneider** | [GitHub](https://github.com/Josh68)
168+
| ![@paintedbicycle](https://avatars3.githubusercontent.com/u/371114?s=75&v=4)| **Paul Wright** | [Website](https://paintedbicycle.com)
169+
````

0 commit comments

Comments
 (0)