Skip to content

Commit 36114bc

Browse files
committedJun 12, 2018
some updates to readmes and custom config annotation
1 parent b7b1682 commit 36114bc

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed
 

‎readme.md

+14-17
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,19 @@ To install a specific StarterKit from GitHub type:
110110
111111
Unlike the other editions, there were a few options added just for this edition that allow for easier upgrading, and better flexibility.
112112
113+
#### Custom Webpack Configuration and Merge Options
114+
115+
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 custom configuration and merge are described [here.](https://github.com/Comcast/patternlab-edition-node-webpack/blob/master/source/_app/readme.md)
116+
117+
You can change how it merges by changing this object in `patternlab-config.json`:
118+
119+
```javascript
120+
"webpackMerge": {
121+
"entry": "replace"
122+
},
123+
```
124+
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)
125+
113126
#### Setting Webpack Dev Server
114127

115128
You can set several options to configure your dev server. You can also in the CLI pass any option on demand.
@@ -126,27 +139,13 @@ You can set several options to configure your dev server. You can also in the CL
126139
}
127140
},
128141
```
129-
130-
#### Setting the Webpack Merge Options
131-
132-
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)
133-
134-
You can change how it merges by changing this object in `patternlab-config.json`:
135-
136-
```javascript
137-
"webpackMerge": {
138-
"entry": "replace"
139-
},
140-
```
141-
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)
142-
143142
#### Modifying the compression settings for bundles
144143

145144
You can safely modify the following settings in the the main `webpack.babel.config` that can change how the bundles get optimized.
146145

147146
_Note: in webpack 4, these settings are automatically triggered when `mode=production` when running the dev server this is not used._
148147

149-
All uglify settings are in the`patternlab-config.json`:
148+
All uglify settings are in the `patternlab-config.json`:
150149

151150
```javascript
152151
"uglify": {
@@ -167,8 +166,6 @@ This can be changed in the`patternlab-config.json` under `app`:
167166
"namespace": ""
168167
}
169168
```
170-
171-
172169
### Licenses
173170
* [babel-cli](https://github.com/babel/babel/blob/master/LICENSE) - MIT
174171
* [babel-core](https://github.com/babel/babel/blob/master/LICENSE) - MIT

‎source/_app/readme.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ Used to store your app specific files.
66

77
**Custom Webpack Configuration**
88

9-
`webpack.app.js` this file is used to place your custom webpack configuration. This will merge or override the values in `webpack.config.babel.js` This will provide a way to change your configuration and still get updates in the future.
9+
The file `/source/_app/webpack.app.js` is your custom webpack configuration. This will merge or override the values in `webpack.config.babel.js`. This will provide a way to change your configuration and still get updates in the future.
10+
11+
**Sample Custom Configuration**
12+
13+
This edition includes [an example configuration](https://github.com/Comcast/patternlab-edition-node-webpack/blob/latest/source/_app/samples/scss/webpack.app.js) for loading, processing, and bundling SASS/SCSS. Use this sample as a template and modify as you like for working with any project asset-types.
1014

1115
### More information
1216

‎source/_app/samples/scss/webpack.app.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
2-
* NOTE: THIS IS A SAMPLE, THIS SHOULD BE webpack.app.js one level higher to be used in your project.
2+
* NOTE: THIS IS A SAMPLE.
3+
* Any configuration to be merged with 'webpack.config.babel.js' SHOULD BE ADDED TO '/source/_app/webpack.app.js'.
34
* Add new dependencies like so:
45
* "yarn add autoprefixer import-glob-loader css-loader node-sass postcss-loader postcss-flexbugs-fixes mini-css-extract-plugin sass-loader style-loader --dev"
56
* or

0 commit comments

Comments
 (0)
Please sign in to comment.