Skip to content

Commit e0c6ca4

Browse files
author
Bulfair, Matt
committed
Merge branch 'latest'
2 parents 2e77944 + 07d1f6d commit e0c6ca4

File tree

8 files changed

+52
-17
lines changed

8 files changed

+52
-17
lines changed

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
{
22
"name": "edition-node-webpack",
33
"description": "A pure wrapper around patternlab-node core, the default pattern engine, and supporting frontend assets.",
4-
"version": "1.0.1",
4+
"version": "1.0.2",
55
"dependencies": {
66
"babel-core": "^6.26.0",
77
"babel-loader": "^7.1.2",
88
"babel-preset-es2015": "^6.24.1",
99
"copy-webpack-plugin": "^4.0.1",
1010
"event-hooks-webpack-plugin": "^1.0.0",
11-
"glob": "^7.1.2",
11+
"globby": "^6.1.0",
1212
"patternlab-node": "^2.11.0",
1313
"styleguidekit-assets-default": "^3.5.0",
1414
"styleguidekit-mustache-default": "^3.0.0",
1515
"webpack": "^3.5.6",
16-
"webpack-config-utils": "^2.3.0"
16+
"webpack-config-utils": "^2.3.0",
17+
"webpack-merge": "^4.1.0"
1718
},
1819
"repository": "[email protected]:Comcast/patternlab-edition-node-webpack.git",
1920
"bugs": "https://github.com/Comcast/patternlab-edition-node-webpack/issues",

patternlab-config.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"paths": {
33
"source": {
44
"root": "./source/",
5+
"app": "./source/_app",
56
"patterns": "./source/_patterns/",
67
"data": "./source/_data/",
78
"meta": "./source/_meta/",
@@ -66,11 +67,12 @@
6667
"patternExportPatternPartials": [],
6768
"patternExportDirectory": "./pattern_exports/",
6869
"cacheBust": true,
69-
"starterkitSubDir": "dist",
70+
"starterkitPostInstallClean": false,
7071
"outputFileSuffixes": {
7172
"rendered": ".rendered",
7273
"rawTemplate": "",
7374
"markupOnly": ".markup-only"
7475
},
75-
"cleanOutputHtml": true
76+
"cleanOutputHtml": true,
77+
"exportToGraphViz": false
7678
}

readme.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The webpack wrapper around [Pattern Lab Node Core](https://github.com/pattern-la
99
## Installation and Starting
1010

1111
1. `yarn install` or `npm install`
12-
2. `yarn start`
12+
2. `yarn start` or `npm run start`
1313

1414

1515
## Packaged Components
@@ -97,10 +97,17 @@ To install a specific StarterKit from GitHub type:
9797
* [babel-preset-es2015](https://github.com/babel/babel/blob/master/LICENSE) - MIT
9898
* [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin/blob/master/LICENSE) - MIT
9999
* [event-hooks-webpack-plugin](https://github.com/cascornelissen/event-hooks-webpack-plugin/blob/master/LICENSE.md) - MIT
100-
* [glob](https://github.com/isaacs/node-glob/blob/master/LICENSE) - ISC
100+
* [globby](https://github.com/sindresorhus/globby/blob/master/license) - MIT
101101
* [patternlab-node](https://github.com/pattern-lab/patternlab-node/blob/master/LICENSE) - MIT
102102
* [styleguidekit-assets-default](https://github.com/pattern-lab/styleguidekit-assets-default/blob/master/LICENSE) - MIT
103103
* [styleguidekit-mustache-default](https://github.com/pattern-lab/styleguidekit-mustache-default/blob/master/LICENSE) - MIT
104104
* [webpack](https://github.com/webpack/webpack/blob/master/LICENSE) - MIT
105105
* [webpack-config-utils](https://github.com/kentcdodds/webpack-config-utils/blob/master/LICENSE) - MIT
106106
* [webpack-dev-server](https://github.com/webpack/webpack-dev-server/blob/master/LICENSE) - MIT
107+
* [webpack-merge](https://github.com/survivejs/webpack-merge/blob/master/LICENSE) - MIT
108+
109+
### Special Thanks and Contributions
110+
111+
Contributor | Special Thanks
112+
----------- | --------------
113+
![@rgualberto](https://avatars3.githubusercontent.com/u/5126167?v=4&s=75)[@rgualberto](https://github.com/rgualberto) | "A huge thank you to a incredible developer [Rodrigo Gualberto](https://github.com/rgualberto) for all of his hard work, dedication, and support from the start of project."

source/_app/.gitkeep

Whitespace-only changes.

source/_app/readme.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
# _app
22

3-
Used to store your app specific files.
3+
Used to store your app specific files.
4+
5+
## Includes
6+
7+
**Custom Webpack Configuration**
8+
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.

source/_app/webpack.app.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const {getIfUtils} = require('webpack-config-utils');
2+
3+
module.exports = env => {
4+
const {ifProd, ifDev} = getIfUtils(env);
5+
6+
const app = {
7+
//Custom webpack configuration goes here
8+
}
9+
return app;
10+
}

webpack.config.babel.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
// webpack.config.js
22
const webpack = require('webpack');
33
const {resolve} = require('path');
4-
const glob = require('glob');
4+
const globby = require('globby');
55
const {getIfUtils, removeEmpty} = require('webpack-config-utils');
66
const CopyWebpackPlugin = require('copy-webpack-plugin');
77
const EventHooksPlugin = require('event-hooks-webpack-plugin');
88
const plConfig = require('./patternlab-config.json');
99
const patternlab = require('patternlab-node')(plConfig);
1010
const patternEngines = require('patternlab-node/core/lib/pattern_engines');
11-
11+
const merge = require('webpack-merge');
12+
const customization = require(`${plConfig.paths.source.app}/webpack.app.js`);
1213

1314
module.exports = env => {
1415
const {ifProd, ifDev} = getIfUtils(env);
15-
const config = ({
16+
const config = merge.smart(customization(env), {
1617
devtool: ifDev('source-map'),
1718
context: resolve(__dirname, 'source'),
1819
node: {
1920
fs: "empty"
2021
},
2122
entry: {
22-
// Gathers any Source JS files and creates a bundle
23-
//NOTE: This name can be changed, if so, make sure to update _meta/01-foot.mustache
24-
"js/pl-source":
25-
glob.sync(resolve(plConfig.paths.source.js + '**/*.js')).map(function (filePath) {
23+
/**
24+
* Gathers any Source JS files and creates a bundle
25+
* Note: To change this, please modify _app/webpack.app.js and use the same key.
26+
*/
27+
"js/pl-source":
28+
globby.sync([resolve(plConfig.paths.source.js + '**/*.js')]).map(function (filePath) {
2629
return filePath;
2730
})
2831
},
@@ -121,7 +124,7 @@ module.exports = env => {
121124
const allWatchFiles = watchFiles.concat(templateFilePaths);
122125

123126
allWatchFiles.forEach(function(globPath) {
124-
const patternFiles = glob.sync(globPath).map(function (filePath) {
127+
const patternFiles = globby.sync(globPath).map(function (filePath) {
125128
return resolve(filePath);
126129
});
127130

yarn.lock

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1719,7 +1719,7 @@ glob@^6.0.4:
17191719
once "^1.3.0"
17201720
path-is-absolute "^1.0.0"
17211721

1722-
glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2:
1722+
glob@^7.0.0, glob@^7.0.3, glob@^7.0.5:
17231723
version "7.1.2"
17241724
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
17251725
dependencies:
@@ -3812,6 +3812,12 @@ webpack-dev-server@^2.7.1:
38123812
webpack-dev-middleware "^1.11.0"
38133813
yargs "^6.6.0"
38143814

3815+
webpack-merge@^4.1.0:
3816+
version "4.1.0"
3817+
resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-4.1.0.tgz#6ad72223b3e0b837e531e4597c199f909361511e"
3818+
dependencies:
3819+
lodash "^4.17.4"
3820+
38153821
webpack-sources@^1.0.1:
38163822
version "1.0.1"
38173823
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.0.1.tgz#c7356436a4d13123be2e2426a05d1dad9cbe65cf"

0 commit comments

Comments
 (0)