From 8b0968bbbfa5eaa19802e0a3bce778cd2743f494 Mon Sep 17 00:00:00 2001 From: shellscape Date: Mon, 23 Oct 2017 17:23:49 -0400 Subject: [PATCH 1/7] adding common style to examples --- examples/assets/favicon.ico | Bin 0 -> 32038 bytes examples/assets/geomanist-medium.woff | Bin 0 -> 19236 bytes examples/assets/geomanist-medium.woff2 | Bin 0 -> 14808 bytes examples/assets/icon-square.svg | 1 + examples/assets/style.css | 67 +++++++++++++++++++++++++ examples/hmr/app.js | 10 +++- examples/hmr/example.js | 4 +- examples/hmr/hmr.js | 11 ---- examples/hmr/index.html | 26 ++++++++-- examples/hmr/webpack.config.js | 11 +++- 10 files changed, 112 insertions(+), 18 deletions(-) create mode 100644 examples/assets/favicon.ico create mode 100644 examples/assets/geomanist-medium.woff create mode 100644 examples/assets/geomanist-medium.woff2 create mode 100644 examples/assets/icon-square.svg create mode 100644 examples/assets/style.css delete mode 100644 examples/hmr/hmr.js diff --git a/examples/assets/favicon.ico b/examples/assets/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..425ac97c61c5055098bdeab8ffd805bc3b08d2fb GIT binary patch literal 32038 zcmeI52Y6jamB&R5OE%z;Lb}rl1lTNLX@NK&guueGw55fbr3V5yPIa0wF-e@>2q74! zkl2o$UK~5NEO*DfNOF;6DK4@tTas-_w)EQU?|)!X?y?5rE zIdkTmGiOF6C2uHsb4kB`C7h2h`Nf+{O3o`ODLMXl|9LduKgoAzoDqFKrKIGWhn19^ zbB_Of+NVoOGM^|ZIgMwyl{fhBIhF9*k{`X(!#)@IEy~kyF~fT zF1g}fm)bDZrPjXSlFRSpyIWkc>TfQ+d2Yfbwom1m{|2ISKqj%RF}-O9&)mnoce_N* zD7R_$y{>NZ?XGshjjn0YNSCa6#3d{5;2k4fx@oaR;wv54+5c`Wl`+(LZ0lUG+=U zjCM=@`fXQw>EUk5WkQQdd zpTFv+T>5TTcEvGn#n?f-?>jtyq&j_T2F!;HJ!!h65OyUur87L0I->PPwgc4X;3m)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OhV#MT zf57u#JBSXA$05h{Prk1f+jiItx%^M|QOqAtyKQsH5IUvuF3YWntnCGQ1?Qsk zzT$M}U-KU09p`t0p8*n>qP4nQWcx1mPgo<`t8PGMv~FB_Kx>S9r$5pm@Ym-?*V?lx zK6b3*TDj+EfH#ADQg-XJ-UpN;bSk(OkmM25k(T4G{{u9}>&Bki)ab{5Erx!LXFzLg zWs{nXN5Qc}isbL$TyP-hv#j@pG12>_L(c?vgY`hhl0TBl5!C+!;{OerZYa>Ni=kh- zjr-)&=>N)S|AxGS0n@=m>zn;J?^U|@h*Ek?oP8e23hjKCVgqUxA~*Yf5)Fd^nVPoDWdy(OP9LOgE5&)y00w zr{82e>f>g=JcqwQ3MTy{c4!=CaJMyN@8v9eEx$VZmx>B#qk8-Us?*NC#8&|%us z*pGi&|D=3R{3ZDb@-;gj>Qm#u7r{YbpUQe~^oQT0da9ky0uKO;+}t7E;BzbSFLpN2 z$Gi9`vR|fxAAm!^>w@k;zs{k~oZkVy3}lCH13ewmZHs|?kQ2au)5qhq_4OJ$#E-+l zPk?+d(HTFa;Ol^V4*4GHLwzk~zrJ7e0JY~yU@*X8F*{wl?LjaAXgt+@`!y}QQ@Myf z*{5fNQQ+4=KE^(wn{wL+@P|YH;YEiwYT#f820PnE4P4m<1f0vXApr+m(1^#++L6Hd z4GegTKJ%s_I=@M8(cy3N|Eory``76&Zz{9XKkvCNq95++=x^-wTRiBqv0Hr1@-^_; f7^`*|;@ctHE}@-lqX^v)wWIwPAAJt(Z0-Jkz!JQP literal 0 HcmV?d00001 diff --git a/examples/assets/geomanist-medium.woff b/examples/assets/geomanist-medium.woff new file mode 100644 index 0000000000000000000000000000000000000000..0912669810efa388e09432588da0859d28da5576 GIT binary patch literal 19236 zcmY&dV{j%-xP4A*`5(T&0U+i!o@PJV1pvVI(@P_VkLZbO3sXZA06_TW$MX{pU_(%a z7PI&f0RRz#pZb3wK?ngWwXk*Z_|XJ@a!mf@Xz2Sxjb&qR{Noe*^`puEK*u9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FkEX!;7Dl3U^LfEz<8#ag2_QM1JhD7 X2eZYWl5+6|D5q0h00CGyFOL8KQ;7od literal 0 HcmV?d00001 diff --git a/examples/assets/geomanist-medium.woff2 b/examples/assets/geomanist-medium.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..9b0bf2e28f4737b8aa533edba8d36704f9a20936 GIT binary patch literal 14808 zcmV;}IVZ+H--onsIK<^ zkORYJr(g)xhI1NEbEQX|WWyNB%mX2%dm<-p@kQ4Zp4JKE*YPLFg^BOC?vInM|J-D= zUKCy^F8&;ts=JnYOt<0XQP|p?eDkEaL`8}W#YY8+2Huw8Py6?s4J9cWks(;C4K1Dl z?yza9lZR-(=XYjy_TKkRBwHxolOZZ0Lh^lE$9x|@bc+hiL=*xZd|^#ay{Nk{+vgwh_OH!k0uxCfhbRaw z@!q7(wZ$|=?J*0~^Gx=LJr$oKRhuzcxjjL$4jjYGOac7ESKi|kx#QKtPB|hGSdr!O zaeO)a`1@Ju@Ab(5B*V!vOV8f~a58X!JHXnbP}Oe2CANrFnWJmXR$P@Op1{&)ShV=t z0pi2|ziK9^I9f$wLJZus4d-*gzAR) z0oeU%eWC$u1I9=Uw&(cgt$kuQ2`_Dvx=2&pReINf|L-r>pEhk~mjg@Ej3PUp z`LrSD&J;IM+9cU~A<7qHwO6HBZFTwe*Qau??ygII{<7)P-57~HV_rPT6Y_*Fbu;<# z8-%LWU15g0AG%wG#wZj*5)>9^k>(!?h$i!UCwr}hAYN%AA|WhG2tmYG&R;70&o!RR z`v(o(vJUk#Hu;9JDpw&U4-Cpgf86yoW>w*aoDATgG)ZWJ;qLyY_LD*YzCZuTPXNHr zug?I$?{`|++kPc*8i1rjX;{XeUy(Hx$h47Q)13gKjZmVsUg|O~Ku_E&698(x2O1+4 zk3T5+7=kw@ZG5YSO!33r+{6o`vGp|%Rm{X;t$d2a;S|CZ`0dS zK=`&=qV)8ZiZo`veOqTWwjGD-+gIu z5tj{I6?+a+XaIKp*q_3y2qh>(1*%YMbrbSt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79l= z?cs1TbwM-&(_)|8L@&ndf{m6HPTs~S9-h3NTdW+jgI1ojlX~9rUD4Bki_%LtA(0{y znfNluz&K!Y1cTznod=k7MPOKDGKmNwz=X>2^{`1?`i5~k;IjO-H3vckEFl3IISD>) zT!uK`AI6UiD^Fe&Pp;g3*flZt>gRFMnADLdE{yv`;-^Q5#3huAMIe(@Jtw8LGv)Ph z*cnmIVCPKIxg6ZFwnVnODj}Y&l9!UF*LjY3fiFwU5yLh0Rk2)l#^NQBj+b>UTO6yv zh9MKq&vh}38*hHlp84HIea&#MECJ8XlXDv&EXlrB%vLbb#PVd4n2F>B{`LAL7_lan z&y%kJk*I=7qf1H4$Ra3)%gJk^yM~OB1`HW7X0j$8W;$za&VnTvE7oj&wF$tP!?cwX zXD(bJAekPCg66@K*IGZA?@U{F&-B4UgbEWb0tQy(FFOG|C$1NSQPy4>x@a*L#4!en zCa&@4>%o+U6-w}7D8p=5q-!;g>#93$;k)my3|TT|%auc5?;1Q$lKW|cl!G3J3mhe8F@n87UmyVAL5$T5d`Yzp1b3w=X|op#2EQ;vs07=}?8 zPy8o}L>ca?c~51!DHL(DAoN9_GL)}c_}%>|Kico%_w;-Dz5PCZUtj0~cekf>SLZ#- z&y#RDENRBkd=$3O6N{J^CBjFu^~C-=8~icon-square-small diff --git a/examples/assets/style.css b/examples/assets/style.css new file mode 100644 index 0000000000..cab39e4d9d --- /dev/null +++ b/examples/assets/style.css @@ -0,0 +1,67 @@ +@font-face { + font-family: 'Geomanist'; + font-style: normal; + font-weight: 600; + src: url('assets/geomanist-medium.woff2') format('woff2'), + url('assets/geomanist-medium.woff') format('woff'); +} + +html, +body { + background-color: #f3f3f3; + color: #2B3A42; + font: 400 10px "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; + height: 100%; + margin: 0; + padding: 0; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +main { + width: 100%; + max-width: 102.4rem; + margin: 0px auto; + padding: 8rem 2.4rem; +} + +h1 { + font-size: 3.4rem; + font-weight: 600; + line-height: 3.4rem; + margin-top: 0; + padding-top: 0; +} + +h1 img { + height: 3.4rem; + width: 3.4rem; + vertical-align: middle; +} + +h2 { + font-size: 2.8rem; +} + +section { + padding: 0 0 0 4.2rem; +} + +p, div { + font-size: 1.6rem; +} + +code { + background-color: rgba(70, 94, 105, 0.06); + border-radius: 3px; + font-family: "Source Code Pro", Consolas, "Liberation Mono", Menlo, Courier, monospace; + font-size: 1.44rem; + margin: 0; + max-width: 100%; + line-height: initial; + overflow: auto; + padding: 2px 6px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); + vertical-align: middle; + white-space: normal; +} diff --git a/examples/hmr/app.js b/examples/hmr/app.js index 265a7d582a..31bc193f1e 100644 --- a/examples/hmr/app.js +++ b/examples/hmr/app.js @@ -1,3 +1,11 @@ 'use strict'; -require('./hmr'); +require('./example'); + +if (module.hot) { + module.hot.accept((err) => { + if (err) { + console.error('Cannot apply HMR update.', err); + } + }); +} diff --git a/examples/hmr/example.js b/examples/hmr/example.js index b863dfaaf2..b3a078c1de 100644 --- a/examples/hmr/example.js +++ b/examples/hmr/example.js @@ -1,5 +1,5 @@ 'use strict'; -const myText = document.getElementById('mytext'); +const target = document.querySelector('#target'); -myText.textContent = 'Does it work? yes'; +target.innerHTML = 'Modify and save /examples/hmr/example.js to update this element without reloading the page.'; diff --git a/examples/hmr/hmr.js b/examples/hmr/hmr.js deleted file mode 100644 index dc9068a482..0000000000 --- a/examples/hmr/hmr.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -require('./example'); - -if (module.hot) { - module.hot.accept((err) => { - if (err) { - console.error('Cannot apply hot update', err); - } - }); -} diff --git a/examples/hmr/index.html b/examples/hmr/index.html index c80b12e47d..fb2c6c4f57 100644 --- a/examples/hmr/index.html +++ b/examples/hmr/index.html @@ -1,8 +1,28 @@ - + + + WDS Example: Hot Module Reloading + + + + + + -

Example: Hot Module Reloading

-
+
+
+

+ + webpack-dev-server +

+
+
+

Hot Module Reloading

+

+ +

+
+
diff --git a/examples/hmr/webpack.config.js b/examples/hmr/webpack.config.js index d6057861cb..529072a7da 100644 --- a/examples/hmr/webpack.config.js +++ b/examples/hmr/webpack.config.js @@ -1,5 +1,6 @@ 'use strict'; +const path = require('path'); const webpack = require('webpack'); module.exports = { @@ -7,5 +8,13 @@ module.exports = { entry: './app.js', plugins: [ new webpack.NamedModulesPlugin() - ] + ], + devServer: { + before(app) { + app.get('/assets/*', (req, res) => { + const filename = path.join(__dirname, '../', req.path); + res.sendFile(filename); + }); + } + } }; From 8da6c252c70d4f3f9aed81452e8500217228abd9 Mon Sep 17 00:00:00 2001 From: shellscape Date: Wed, 25 Oct 2017 08:51:17 -0400 Subject: [PATCH 2/7] giving the examples that new hotness --- examples/README.md | 22 +- .../{hmr/index.html => assets/layout.html} | 4 +- examples/compression/README.md | 24 +- examples/compression/index.html | 9 - examples/compression/webpack.config.js | 8 +- examples/hmr/README.md | 23 +- examples/hmr/webpack.config.js | 22 +- examples/util.js | 76 ++++ package-lock.json | 335 ++++++++++++++++++ package.json | 2 + 10 files changed, 475 insertions(+), 50 deletions(-) rename examples/{hmr/index.html => assets/layout.html} (85%) delete mode 100644 examples/compression/index.html create mode 100644 examples/util.js diff --git a/examples/README.md b/examples/README.md index 5c758f307d..f87343610c 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,9 +1,21 @@ # Examples -Each example showcases a feature. You can use this to learn how to use that feature, but also use it to test if something still works when making a Pull Request. +Each example showcases a particular feature of `webpack-dev-server`. You can use +these examples to learn how to use certain features, or as a means to test features +when working on a Pull Request. -An example should be as minimal as possible, and consists of: +An example should be as minimal as possible and consists of at least: -- The code that is necessary -- Instructions on how to run -- A description of what should happen +- An `app.js` file - the entry point for an example app. +- A `README.md` file containing information about, and how to run the example app. +- A description of what should happen when running the example. +- A `wepack.config.js` file containing the `webpack` configuration for the example app. + +## Notes + +- Each example's `webpack` config is wrapped with `util.setup`; a helper function +that adds plugins and configuration needed by each example to render in a consistent +and visually pleasing way. +- Examples' `bundle.js` and `index.html` files are compiled and served from memory. +You won't actually see these files written to disk, but if you examine the `webpack` +output, you should see their file indicators. diff --git a/examples/hmr/index.html b/examples/assets/layout.html similarity index 85% rename from examples/hmr/index.html rename to examples/assets/layout.html index fb2c6c4f57..0438095f6c 100644 --- a/examples/hmr/index.html +++ b/examples/assets/layout.html @@ -1,7 +1,7 @@ - WDS Example: Hot Module Reloading + WDS Example: <%= htmlWebpackPlugin.options.title %> @@ -17,7 +17,7 @@

-

Hot Module Reloading

+

<%= htmlWebpackPlugin.options.title %>

diff --git a/examples/compression/README.md b/examples/compression/README.md index b9a2df4baa..5c06a61039 100644 --- a/examples/compression/README.md +++ b/examples/compression/README.md @@ -1,13 +1,25 @@ -# Compression +# Gzip Compression -```shell +Website gzip compression makes it possible to reduce the file size of a file +to roughly 30% of its original size before the files are sent to the browser. + +To run this example, run this command in your console or terminal: + +```console node ../../bin/webpack-dev-server.js --open --compress ``` -Gzip compression is enabled. - ## What should happen -The script should open `https://localhost:8080/`. +1. The script should open `https://localhost:8080/`. +2. Files being sent to the browser from the `webpack` bundle should be gzipped. +3. Open the console in your browser's devtools and select the _Network_ tab. +4. Find `bundle.js`. The response headers should contain `Content-Encoding: gzip`. + +## Notes + +Some browsers, such as Chrome, won't show the `Content-Encoding: gzip` within +the _Response Headers_. This has been documented [here](https://github.com/expressjs/compression/issues/96). -Open the devtools -> `Network` tab, and find `bundle.js`. The response headers should have a `Content-Encoding: gzip` header. +To enable `Content-Encoding` for _Response Headers_ in Chrome, you can follow +[this tutorial](https://www.youtube.com/watch?v=47R6uv0RKCk). diff --git a/examples/compression/index.html b/examples/compression/index.html deleted file mode 100644 index c08de1e2fb..0000000000 --- a/examples/compression/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -

Example: compression

- - diff --git a/examples/compression/webpack.config.js b/examples/compression/webpack.config.js index 7316e8848c..009e0ca78e 100644 --- a/examples/compression/webpack.config.js +++ b/examples/compression/webpack.config.js @@ -1,6 +1,10 @@ 'use strict'; -module.exports = { +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../util'); + +module.exports = setup({ context: __dirname, entry: './app.js' -}; +}); diff --git a/examples/hmr/README.md b/examples/hmr/README.md index 358d1ccb0a..f505c9f3df 100644 --- a/examples/hmr/README.md +++ b/examples/hmr/README.md @@ -1,18 +1,21 @@ # Hot Module Reloading -```shell -node ../../bin/webpack-dev-server.js --open --hot -``` +Hot Module Replacement (HMR) exchanges, adds, or removes modules while an +application is running, without a full reload of the page. -With Hot Module Reloading we want to apply updates to the page without fully refreshing it. +To run this example, run this command in your console or terminal: -## What should happen +```console +node ../../bin/webpack-dev-server.js --open --hot +``` -The script should open `http://localhost:8080/`. In the app you should see "Does it work?" +## What Should Happen -In your editor, go to `example.js`, and change "Does it work?" to "It works!" +1. The script should open `http://localhost:8080/` in your default browser. +2. In your editor, open `example.js` and change any part of the `innerHTML` string. +3. Open the console in your browser's devtools. -Open the devtools for the app, and you should see: +In the devtools console you should see: ``` [WDS] App updated. Recompiling... @@ -20,8 +23,8 @@ Open the devtools for the app, and you should see: [HMR] Checking for updates on the server... [HMR] Updated modules: [HMR] - ./example.js -[HMR] - ./hmr.js [HMR] App is up to date. ``` -Also verify that the text actually in the app actually changed to "It works!" +You should also see the text on the page itself change to match your edits in +`example.js`. diff --git a/examples/hmr/webpack.config.js b/examples/hmr/webpack.config.js index 529072a7da..009e0ca78e 100644 --- a/examples/hmr/webpack.config.js +++ b/examples/hmr/webpack.config.js @@ -1,20 +1,10 @@ 'use strict'; -const path = require('path'); -const webpack = require('webpack'); +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../util'); -module.exports = { +module.exports = setup({ context: __dirname, - entry: './app.js', - plugins: [ - new webpack.NamedModulesPlugin() - ], - devServer: { - before(app) { - app.get('/assets/*', (req, res) => { - const filename = path.join(__dirname, '../', req.path); - res.sendFile(filename); - }); - } - } -}; + entry: './app.js' +}); diff --git a/examples/util.js b/examples/util.js new file mode 100644 index 0000000000..74571d1dd1 --- /dev/null +++ b/examples/util.js @@ -0,0 +1,76 @@ +'use strict'; + +/* eslint-disable import/no-extraneous-dependencies */ + +const fs = require('fs'); +const path = require('path'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const marked = require('marked'); +const webpack = require('webpack'); + +module.exports = { + setup(config) { + const defaults = { plugins: [], devServer: {} }; + const result = Object.assign(defaults, config); + const before = function before(app) { + app.get('/assets/*', (req, res) => { + const filename = path.join(__dirname, '/', req.path); + res.sendFile(filename); + }); + }; + const renderer = new marked.Renderer(); + const heading = renderer.heading; + const markedOptions = { + gfm: true, + tables: true, + breaks: false, + pedantic: false, + sanitize: false, + sanitizer: null, + mangle: true, + smartLists: false, + silent: false, + langPrefix: 'lang-', + smartypants: false, + headerPrefix: '', + renderer, + xhtml: false + }; + const readme = fs.readFileSync('README.md', 'utf-8'); + + let exampleTitle = ''; + + renderer.heading = function headingProxy(text, level, raw) { + if (level === 1 && !exampleTitle) { + exampleTitle = text; + } + + return heading.call(this, text, level, raw); + }; + + marked.setOptions(markedOptions); + + marked(readme, { renderer }); + + result.plugins.push(new webpack.NamedModulesPlugin()); + result.plugins.push(new HtmlWebpackPlugin({ + filename: 'index.html', + template: '../assets/layout.html', + title: exampleTitle + })); + + if (result.devServer.before) { + const proxy = result.devServer.before; + result.devServer.before = function replace(app) { + before(app); + proxy(app); + }; + } else { + result.devServer.before = before; + } + + result.output = { path: path.dirname(module.parent.filename) }; + + return result; + } +}; diff --git a/package-lock.json b/package-lock.json index d14423d5f5..34425cfb43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -411,6 +411,12 @@ "multicast-dns-service-types": "1.1.0" } }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", + "dev": true + }, "boom": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz", @@ -605,6 +611,16 @@ "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", "dev": true }, + "camel-case": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", + "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=", + "dev": true, + "requires": { + "no-case": "2.3.2", + "upper-case": "1.1.3" + } + }, "camelcase": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", @@ -1178,6 +1194,18 @@ "source-list-map": "2.0.0" } }, + "css-select": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", + "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", + "dev": true, + "requires": { + "boolbase": "1.0.0", + "css-what": "2.1.0", + "domutils": "1.5.1", + "nth-check": "1.0.1" + } + }, "css-selector-tokenizer": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.7.0.tgz", @@ -1189,6 +1217,12 @@ "regexpu-core": "1.0.0" } }, + "css-what": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.0.tgz", + "integrity": "sha1-lGfQMsOM+u+58teVASUwYvh/ob0=", + "dev": true + }, "cssesc": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-0.1.0.tgz", @@ -1447,12 +1481,72 @@ "integrity": "sha1-6oCxBqh1OHdOijpKWv4pPeSJ4Kk=", "dev": true }, + "dom-converter": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.1.4.tgz", + "integrity": "sha1-pF71cnuJDJv/5tfIduexnLDhfzs=", + "dev": true, + "requires": { + "utila": "0.3.3" + }, + "dependencies": { + "utila": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/utila/-/utila-0.3.3.tgz", + "integrity": "sha1-1+jn1+MJEHCSsF+NloiCTWM6QiY=", + "dev": true + } + } + }, + "dom-serializer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", + "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "dev": true, + "requires": { + "domelementtype": "1.1.3", + "entities": "1.1.1" + }, + "dependencies": { + "domelementtype": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", + "dev": true + } + } + }, "domain-browser": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", "dev": true }, + "domelementtype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", + "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", + "dev": true + }, + "domhandler": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.1.0.tgz", + "integrity": "sha1-0mRvXlf2w7qxHPbLBdPArPdBJZQ=", + "dev": true, + "requires": { + "domelementtype": "1.3.0" + } + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "requires": { + "dom-serializer": "0.1.0", + "domelementtype": "1.3.0" + } + }, "duplexer": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", @@ -1539,6 +1633,12 @@ "tapable": "0.2.8" } }, + "entities": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "dev": true + }, "errno": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz", @@ -3476,6 +3576,132 @@ "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.2.1.tgz", "integrity": "sha1-DfKTUfByEWNRXfueVUPl9u7VFi8=" }, + "html-minifier": { + "version": "3.5.6", + "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-3.5.6.tgz", + "integrity": "sha512-88FjtKrlak2XjczhxrBomgzV4jmGzM3UnHRBScRkJcmcRum0kb+IwhVAETJ8AVp7j0p3xugjSaw9L+RmI5/QOA==", + "dev": true, + "requires": { + "camel-case": "3.0.0", + "clean-css": "4.1.9", + "commander": "2.11.0", + "he": "1.1.1", + "ncname": "1.0.0", + "param-case": "2.1.1", + "relateurl": "0.2.7", + "uglify-js": "3.1.5" + }, + "dependencies": { + "clean-css": { + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.1.9.tgz", + "integrity": "sha1-Nc7ornaHpJuYA09w3gDE7dOCYwE=", + "dev": true, + "requires": { + "source-map": "0.5.7" + } + }, + "commander": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "dev": true + }, + "uglify-js": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.1.5.tgz", + "integrity": "sha512-tSqlO7/GZHAVSw6mbtJt2kz0ZcUrKUH7Xg92o52aE+gL0r6cXiASZY4dpHqQ7RVGXmoQuPA2qAkG4TkP59f8XA==", + "dev": true, + "requires": { + "commander": "2.11.0", + "source-map": "0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + } + } + }, + "html-webpack-plugin": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-2.30.1.tgz", + "integrity": "sha1-f5xCG36pHsRg9WUn1430hO51N9U=", + "dev": true, + "requires": { + "bluebird": "3.5.0", + "html-minifier": "3.5.6", + "loader-utils": "0.2.17", + "lodash": "4.17.4", + "pretty-error": "2.1.1", + "toposort": "1.0.6" + }, + "dependencies": { + "loader-utils": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "dev": true, + "requires": { + "big.js": "3.1.3", + "emojis-list": "2.1.0", + "json5": "0.5.1", + "object-assign": "4.1.1" + } + } + } + }, + "htmlparser2": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.3.0.tgz", + "integrity": "sha1-zHDQWln2VC5D8OaFyYLhTJJKnv4=", + "dev": true, + "requires": { + "domelementtype": "1.3.0", + "domhandler": "2.1.0", + "domutils": "1.1.6", + "readable-stream": "1.0.34" + }, + "dependencies": { + "domutils": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.1.6.tgz", + "integrity": "sha1-vdw94Jm5ou+sxRxiPyj0FuzFdIU=", + "dev": true, + "requires": { + "domelementtype": "1.3.0" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, "http-deceiver": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", @@ -4640,6 +4866,12 @@ "signal-exit": "3.0.2" } }, + "lower-case": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", + "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=", + "dev": true + }, "lru-cache": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", @@ -4678,6 +4910,12 @@ "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" }, + "marked": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.6.tgz", + "integrity": "sha1-ssbGGPzOzk74bE/Gy4p8v1rtqNc=", + "dev": true + }, "math-expression-evaluator": { "version": "1.2.17", "resolved": "https://registry.npmjs.org/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz", @@ -5061,6 +5299,15 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "ncname": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ncname/-/ncname-1.0.0.tgz", + "integrity": "sha1-W1etGLHKCShk72Kwse2BlPODtxw=", + "dev": true, + "requires": { + "xml-char-classes": "1.0.0" + } + }, "negotiator": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", @@ -5101,6 +5348,15 @@ } } }, + "no-case": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", + "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", + "dev": true, + "requires": { + "lower-case": "1.1.4" + } + }, "node-forge": { "version": "0.6.33", "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.6.33.tgz", @@ -5206,6 +5462,15 @@ "path-key": "2.0.1" } }, + "nth-check": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.1.tgz", + "integrity": "sha1-mSms32KPwsQQmN6rgqxYDPFJquQ=", + "dev": true, + "requires": { + "boolbase": "1.0.0" + } + }, "num2fraction": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", @@ -5398,6 +5663,15 @@ "readable-stream": "2.3.3" } }, + "param-case": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", + "integrity": "sha1-35T9jPZTHs915r75oIWPvHK+Ikc=", + "dev": true, + "requires": { + "no-case": "2.3.2" + } + }, "parse-asn1": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.0.tgz", @@ -6085,6 +6359,16 @@ "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=" }, + "pretty-error": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-2.1.1.tgz", + "integrity": "sha1-X0+HyPkeWuPzuoerTPXgOxoX8aM=", + "dev": true, + "requires": { + "renderkid": "2.0.1", + "utila": "0.4.0" + } + }, "process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -6566,11 +6850,38 @@ "jsesc": "0.5.0" } }, + "relateurl": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", + "integrity": "sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=", + "dev": true + }, "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" }, + "renderkid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/renderkid/-/renderkid-2.0.1.tgz", + "integrity": "sha1-iYyr/Ivt5Le5ETWj/9Mj5YwNsxk=", + "dev": true, + "requires": { + "css-select": "1.2.0", + "dom-converter": "0.1.4", + "htmlparser2": "3.3.0", + "strip-ansi": "3.0.1", + "utila": "0.3.3" + }, + "dependencies": { + "utila": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/utila/-/utila-0.3.3.tgz", + "integrity": "sha1-1+jn1+MJEHCSsF+NloiCTWM6QiY=", + "dev": true + } + } + }, "repeat-element": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", @@ -7575,6 +7886,12 @@ "integrity": "sha1-zu78cXp2xDFvEm0LnbqlXX598Bo=", "dev": true }, + "toposort": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/toposort/-/toposort-1.0.6.tgz", + "integrity": "sha1-wxdI5V0hDv/AD9zcfW5o19e7nOw=", + "dev": true + }, "tough-cookie": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", @@ -7783,6 +8100,12 @@ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" }, + "upper-case": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", + "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=", + "dev": true + }, "url": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", @@ -7858,6 +8181,12 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, + "utila": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/utila/-/utila-0.4.0.tgz", + "integrity": "sha1-ihagXURWV6Oupe7MWxKk+lN5dyw=", + "dev": true + }, "utils-merge": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", @@ -8223,6 +8552,12 @@ "ultron": "1.1.0" } }, + "xml-char-classes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/xml-char-classes/-/xml-char-classes-1.0.0.tgz", + "integrity": "sha1-ZGV4SKIP/F31g6Qq2KJ3tFErvE0=", + "dev": true + }, "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", diff --git a/package.json b/package.json index 8b80bb6a31..c3f220c258 100644 --- a/package.json +++ b/package.json @@ -76,10 +76,12 @@ "eslint-plugin-import": "^2.7.0", "execa": "^0.8.0", "file-loader": "^0.11.2", + "html-webpack-plugin": "^2.30.1", "istanbul": "^0.4.5", "jquery": "^3.2.1", "less": "^2.5.1", "less-loader": "^4.0.5", + "marked": "^0.3.6", "mocha": "^3.0.2", "mocha-sinon": "^2.0.0", "pug": "^2.0.0-beta5", From b6454d6fe4f5cb9297c51ff03a6117e54b9d7c4d Mon Sep 17 00:00:00 2001 From: shellscape Date: Thu, 9 Nov 2017 00:07:48 -0500 Subject: [PATCH 3/7] reorg examples based on exec type continuing restyle implement npm script method to run examples --- examples/api/middleware/README.md | 20 +++++++++++++ examples/api/middleware/app.js | 6 ++++ .../middleware}/server.js | 5 ++-- examples/api/middleware/webpack.config.js | 13 +++++++++ examples/api/simple/README.md | 17 +++++++++++ .../{node-api-simple => api/simple}/app.js | 9 ++++-- .../{node-api-simple => api/simple}/server.js | 5 ++-- examples/api/simple/webpack.config.js | 13 +++++++++ examples/assets/layout.html | 4 +-- examples/assets/style.css | 29 ++++++++++++++++++- examples/bonjour/README.md | 10 ------- examples/bonjour/app.js | 3 -- examples/bonjour/index.html | 9 ------ examples/cli-open-page/README.md | 11 ------- examples/cli-open-page/app.js | 5 ---- examples/cli-open-page/example.html | 9 ------ examples/cli-open-page/webpack.config.js | 6 ---- examples/cli-public-protocol/README.md | 13 --------- examples/cli-public-protocol/app.js | 5 ---- .../cli-public-protocol/webpack.config.js | 11 ------- examples/cli-public/README.md | 15 ---------- examples/cli-public/app.js | 3 -- examples/cli-public/index.html | 9 ------ examples/cli-public/webpack.config.js | 6 ---- examples/cli-stdin/README.md | 11 ------- examples/cli-stdin/app.js | 3 -- examples/cli-stdin/index.html | 9 ------ examples/cli-stdin/webpack.config.js | 6 ---- examples/cli/bonjour/README.md | 15 ++++++++++ examples/cli/bonjour/app.js | 5 ++++ .../{hmr => cli/bonjour}/webpack.config.js | 2 +- examples/{ => cli}/hmr/README.md | 2 +- examples/{ => cli}/hmr/app.js | 0 examples/{ => cli}/hmr/example.js | 0 examples/cli/hmr/webpack.config.js | 10 +++++++ examples/cli/open-page/README.md | 14 +++++++++ examples/cli/open-page/app.js | 11 +++++++ examples/cli/open-page/webpack.config.js | 18 ++++++++++++ examples/cli/public-protocol/README.md | 18 ++++++++++++ examples/cli/public-protocol/app.js | 5 ++++ .../public-protocol}/index.html | 0 .../cli/public-protocol/webpack.config.js | 15 ++++++++++ examples/cli/public/README.md | 21 ++++++++++++++ examples/cli/public/app.js | 6 ++++ examples/cli/public/webpack.config.js | 10 +++++++ examples/cli/stdin/README.md | 16 ++++++++++ examples/cli/stdin/app.js | 5 ++++ .../{bonjour => cli/stdin}/webpack.config.js | 0 examples/node-api-middleware/README.md | 18 ------------ examples/node-api-middleware/app.js | 12 -------- examples/node-api-middleware/index.html | 9 ------ .../node-api-middleware/webpack.config.js | 9 ------ examples/node-api-simple/README.md | 15 ---------- examples/node-api-simple/index.html | 9 ------ examples/node-api-simple/webpack.config.js | 9 ------ examples/util.js | 5 +++- lib/Server.js | 6 +++- package.json | 3 +- 58 files changed, 293 insertions(+), 240 deletions(-) create mode 100644 examples/api/middleware/README.md create mode 100644 examples/api/middleware/app.js rename examples/{node-api-middleware => api/middleware}/server.js (68%) create mode 100644 examples/api/middleware/webpack.config.js create mode 100644 examples/api/simple/README.md rename examples/{node-api-simple => api/simple}/app.js (50%) rename examples/{node-api-simple => api/simple}/server.js (59%) create mode 100644 examples/api/simple/webpack.config.js delete mode 100644 examples/bonjour/README.md delete mode 100644 examples/bonjour/app.js delete mode 100644 examples/bonjour/index.html delete mode 100644 examples/cli-open-page/README.md delete mode 100644 examples/cli-open-page/app.js delete mode 100644 examples/cli-open-page/example.html delete mode 100644 examples/cli-open-page/webpack.config.js delete mode 100644 examples/cli-public-protocol/README.md delete mode 100644 examples/cli-public-protocol/app.js delete mode 100644 examples/cli-public-protocol/webpack.config.js delete mode 100644 examples/cli-public/README.md delete mode 100644 examples/cli-public/app.js delete mode 100644 examples/cli-public/index.html delete mode 100644 examples/cli-public/webpack.config.js delete mode 100644 examples/cli-stdin/README.md delete mode 100644 examples/cli-stdin/app.js delete mode 100644 examples/cli-stdin/index.html delete mode 100644 examples/cli-stdin/webpack.config.js create mode 100644 examples/cli/bonjour/README.md create mode 100644 examples/cli/bonjour/app.js rename examples/{hmr => cli/bonjour}/webpack.config.js (81%) rename examples/{ => cli}/hmr/README.md (94%) rename examples/{ => cli}/hmr/app.js (100%) rename examples/{ => cli}/hmr/example.js (100%) create mode 100644 examples/cli/hmr/webpack.config.js create mode 100644 examples/cli/open-page/README.md create mode 100644 examples/cli/open-page/app.js create mode 100644 examples/cli/open-page/webpack.config.js create mode 100644 examples/cli/public-protocol/README.md create mode 100644 examples/cli/public-protocol/app.js rename examples/{cli-public-protocol => cli/public-protocol}/index.html (100%) create mode 100644 examples/cli/public-protocol/webpack.config.js create mode 100644 examples/cli/public/README.md create mode 100644 examples/cli/public/app.js create mode 100644 examples/cli/public/webpack.config.js create mode 100644 examples/cli/stdin/README.md create mode 100644 examples/cli/stdin/app.js rename examples/{bonjour => cli/stdin}/webpack.config.js (100%) delete mode 100644 examples/node-api-middleware/README.md delete mode 100644 examples/node-api-middleware/app.js delete mode 100644 examples/node-api-middleware/index.html delete mode 100644 examples/node-api-middleware/webpack.config.js delete mode 100644 examples/node-api-simple/README.md delete mode 100644 examples/node-api-simple/index.html delete mode 100644 examples/node-api-simple/webpack.config.js diff --git a/examples/api/middleware/README.md b/examples/api/middleware/README.md new file mode 100644 index 0000000000..91c0ce0501 --- /dev/null +++ b/examples/api/middleware/README.md @@ -0,0 +1,20 @@ +# API: Custom Middleware + +While it's recommended to run `webpack-dev-server` via the CLI, you may also +choose to start a server via the API. This example demonstrates using one of the +few custom middleware options; `before`. + +```console +node server.js +``` + +## What Should Happen + +1. Open `http://localhost:8080/` in your preferred browser. +2. You should see the text on the page itself change to read `Success!`. +3. In the console/terminal, you should see the following for each refresh in +the browser: +``` +Using middleware for / +Using middleware for /bundle.js +``` diff --git a/examples/api/middleware/app.js b/examples/api/middleware/app.js new file mode 100644 index 0000000000..ae384858b9 --- /dev/null +++ b/examples/api/middleware/app.js @@ -0,0 +1,6 @@ +'use strict'; + +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; diff --git a/examples/node-api-middleware/server.js b/examples/api/middleware/server.js similarity index 68% rename from examples/node-api-middleware/server.js rename to examples/api/middleware/server.js index eaa59584a2..a90ecedd46 100644 --- a/examples/node-api-middleware/server.js +++ b/examples/api/middleware/server.js @@ -1,11 +1,11 @@ 'use strict'; const Webpack = require('webpack'); -const WebpackDevServer = require('../../lib/Server'); +const WebpackDevServer = require('../../../lib/Server'); const webpackConfig = require('./webpack.config'); const compiler = Webpack(webpackConfig); -const server = new WebpackDevServer(compiler, { +const devServerOptions = Object.assign({}, webpackConfig.devServer, { stats: { colors: true }, @@ -16,6 +16,7 @@ const server = new WebpackDevServer(compiler, { }); } }); +const server = new WebpackDevServer(compiler, devServerOptions); server.listen(8080, '127.0.0.1', () => { console.log('Starting server on http://localhost:8080'); diff --git a/examples/api/middleware/webpack.config.js b/examples/api/middleware/webpack.config.js new file mode 100644 index 0000000000..aac2110327 --- /dev/null +++ b/examples/api/middleware/webpack.config.js @@ -0,0 +1,13 @@ +'use strict'; + +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ + context: __dirname, + entry: ['./app.js', '../../client/index.js?http://localhost:8080/'], + output: { + filename: 'bundle.js' + } +}); diff --git a/examples/api/simple/README.md b/examples/api/simple/README.md new file mode 100644 index 0000000000..81064650b5 --- /dev/null +++ b/examples/api/simple/README.md @@ -0,0 +1,17 @@ +# API: Simple Server + +While it's recommended to run `webpack-dev-server` via the CLI, you may also +choose to start a server via the API. This example starts a simple server setup. + +```console +node server.js +``` + +## What should happen + +1. Open `http://localhost:8080/` in your preferred browser. +2. You should see the text on the page itself change to read `Success!`. +3. In `app.js`, uncomment the code that results in an error and save. This error +should be visible in the console/terminal and in browser devtools. +4. In `app.js`, uncomment the code that results in a warning. This warning should +be visible in the console/terminal and in browser devtools. diff --git a/examples/node-api-simple/app.js b/examples/api/simple/app.js similarity index 50% rename from examples/node-api-simple/app.js rename to examples/api/simple/app.js index e45e577a65..4ad52540c6 100644 --- a/examples/node-api-simple/app.js +++ b/examples/api/simple/app.js @@ -1,6 +1,9 @@ 'use strict'; -document.write("It's working."); +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; // This results in a warning: if (!window) { @@ -9,4 +12,6 @@ if (!window) { } // This results in an error: -// if(!window) require("test"); +// if(!window) { +// require("test"); +// } diff --git a/examples/node-api-simple/server.js b/examples/api/simple/server.js similarity index 59% rename from examples/node-api-simple/server.js rename to examples/api/simple/server.js index b73257eeb0..3e148e047b 100644 --- a/examples/node-api-simple/server.js +++ b/examples/api/simple/server.js @@ -1,15 +1,16 @@ 'use strict'; const Webpack = require('webpack'); -const WebpackDevServer = require('../../lib/Server'); +const WebpackDevServer = require('../../../lib/Server'); const webpackConfig = require('./webpack.config'); const compiler = Webpack(webpackConfig); -const server = new WebpackDevServer(compiler, { +const devServerOptions = Object.assign({}, webpackConfig.devServer, { stats: { colors: true } }); +const server = new WebpackDevServer(compiler, devServerOptions); server.listen(8080, '127.0.0.1', () => { console.log('Starting server on http://localhost:8080'); diff --git a/examples/api/simple/webpack.config.js b/examples/api/simple/webpack.config.js new file mode 100644 index 0000000000..e53c0a3c36 --- /dev/null +++ b/examples/api/simple/webpack.config.js @@ -0,0 +1,13 @@ +'use strict'; + +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ + context: __dirname, + entry: ['./app.js', '../../../client/index.js?http://localhost:8080/'], + output: { + filename: 'bundle.js' + } +}); diff --git a/examples/assets/layout.html b/examples/assets/layout.html index 0438095f6c..2c675125c9 100644 --- a/examples/assets/layout.html +++ b/examples/assets/layout.html @@ -18,9 +18,7 @@

<%= htmlWebpackPlugin.options.title %>

-

- -

+
diff --git a/examples/assets/style.css b/examples/assets/style.css index cab39e4d9d..1faa447900 100644 --- a/examples/assets/style.css +++ b/examples/assets/style.css @@ -20,7 +20,7 @@ body { main { width: 100%; - max-width: 102.4rem; + max-width: 94.2rem; margin: 0px auto; padding: 8rem 2.4rem; } @@ -65,3 +65,30 @@ code { vertical-align: middle; white-space: normal; } + +#target { + background: #DCF2FD; + border: 0.1rem solid #618ca0; + border-radius: 0.3rem; + color: #618ca0; + margin: 2rem 0; + padding: 2rem; +} + +#target.warn { + background: #fcf8e3; + border: 0.1rem solid #8a6d3b; + color: #8a6d3b; +} + +#target.pass { + background: #f2f9f4; + border: 0.1rem solid #4db277; + color: #4db277; +} + +#target.fail { + background: #f2dede; + border: 0.1rem solid #a94442; + color: #a94442; +} diff --git a/examples/bonjour/README.md b/examples/bonjour/README.md deleted file mode 100644 index 37d3027b38..0000000000 --- a/examples/bonjour/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# host and port - -For basic usage -```shell -node ../../bin/webpack-dev-server.js --bonjour -``` - -## What should happen - -It should publish a zeroconf service with a type of `http` and a subtype of `webpack`. diff --git a/examples/bonjour/app.js b/examples/bonjour/app.js deleted file mode 100644 index 7b9ea7ebaa..0000000000 --- a/examples/bonjour/app.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -document.write("It's working."); diff --git a/examples/bonjour/index.html b/examples/bonjour/index.html deleted file mode 100644 index cfd4b2c045..0000000000 --- a/examples/bonjour/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -

Example: host and port

- - diff --git a/examples/cli-open-page/README.md b/examples/cli-open-page/README.md deleted file mode 100644 index 7dabcd6376..0000000000 --- a/examples/cli-open-page/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# CLI - OPEN-PAGE - -```shell -node ../../bin/webpack-dev-server.js --open-page example.html#page1 -``` - -Some applications may consist of multiple web pages. During development it may be useful to directly open a particular page. The page to open may be specified as the argument to the `open-page` option. - -## What should happen - -The script should open `http://localhost:8080/example.html#page1`. In the app you should see "It's working." diff --git a/examples/cli-open-page/app.js b/examples/cli-open-page/app.js deleted file mode 100644 index 85f5ab6624..0000000000 --- a/examples/cli-open-page/app.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -if (window.location.href.endsWith('example.html#page1')) { - document.write("It's working."); -} diff --git a/examples/cli-open-page/example.html b/examples/cli-open-page/example.html deleted file mode 100644 index 49677b7e04..0000000000 --- a/examples/cli-open-page/example.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -

Example: CLI - open-page

- - diff --git a/examples/cli-open-page/webpack.config.js b/examples/cli-open-page/webpack.config.js deleted file mode 100644 index 7316e8848c..0000000000 --- a/examples/cli-open-page/webpack.config.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -module.exports = { - context: __dirname, - entry: './app.js' -}; diff --git a/examples/cli-public-protocol/README.md b/examples/cli-public-protocol/README.md deleted file mode 100644 index bae3f9981f..0000000000 --- a/examples/cli-public-protocol/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# CLI - public protocol - -NOTE: replace `` with your local ip. - -```shell -node ../../bin/webpack-dev-server.js -``` - -You're now able to explicitly define the protocol used with the `public` option (have a look to the config provided in `webpack.config.js`). - -## What should happen - -If you open your browser at `http://localhost:8080` you'll see that dev-server tries to establish a connection to `/sockjs-node` via the explicitly defined `https://localhost:8080`. This fails of course since we're not hosting https. diff --git a/examples/cli-public-protocol/app.js b/examples/cli-public-protocol/app.js deleted file mode 100644 index ea0ccbbd43..0000000000 --- a/examples/cli-public-protocol/app.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -document.open(); -document.write('Please check the sockjs-info request in your dev-tools, it should try to connect to the protocol + server defined in the public setting.'); -document.close(); diff --git a/examples/cli-public-protocol/webpack.config.js b/examples/cli-public-protocol/webpack.config.js deleted file mode 100644 index 5b368e59ab..0000000000 --- a/examples/cli-public-protocol/webpack.config.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -module.exports = { - context: __dirname, - entry: './app.js', - devServer: { - host: '0.0.0.0', - public: 'https://localhost:8080', - disableHostCheck: true - } -}; diff --git a/examples/cli-public/README.md b/examples/cli-public/README.md deleted file mode 100644 index 9902488a4f..0000000000 --- a/examples/cli-public/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# CLI - public - -NOTE: replace `` with your local ip. - -```shell -node ../../bin/webpack-dev-server.js --open --host 0.0.0.0 --public :8080 -``` - -If you want to make the client publicly accessible, the client needs to know with what host to connect to the server. If `--host 0.0.0.0` is given, the client would try to connect to `0.0.0.0`. With `--public` it is possible to override this. - -## What should happen - -The script should open `http://0.0.0.0:8080/`. In the app you should see "It's working." - -Verify that the websocket is connecting to `:8080`. Go to devtools -> Network, click on "websocket" and check "Request URL". diff --git a/examples/cli-public/app.js b/examples/cli-public/app.js deleted file mode 100644 index 7b9ea7ebaa..0000000000 --- a/examples/cli-public/app.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -document.write("It's working."); diff --git a/examples/cli-public/index.html b/examples/cli-public/index.html deleted file mode 100644 index bf2aa9c504..0000000000 --- a/examples/cli-public/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -

Example: CLI - public

- - diff --git a/examples/cli-public/webpack.config.js b/examples/cli-public/webpack.config.js deleted file mode 100644 index 7316e8848c..0000000000 --- a/examples/cli-public/webpack.config.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -module.exports = { - context: __dirname, - entry: './app.js' -}; diff --git a/examples/cli-stdin/README.md b/examples/cli-stdin/README.md deleted file mode 100644 index 05ce0aeccf..0000000000 --- a/examples/cli-stdin/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# CLI - stdin - -```shell -node ../../bin/webpack-dev-server.js --stdin -``` - -When stdin ends, we want to close the webpack-dev-server. - -## What should happen - -The script should start up. When `ctrl+D` is pressed, the server should quit. Note that the shortcut can differ on operating systems, but the point is to signify the end of input. diff --git a/examples/cli-stdin/app.js b/examples/cli-stdin/app.js deleted file mode 100644 index 7b9ea7ebaa..0000000000 --- a/examples/cli-stdin/app.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -document.write("It's working."); diff --git a/examples/cli-stdin/index.html b/examples/cli-stdin/index.html deleted file mode 100644 index d362c8e17b..0000000000 --- a/examples/cli-stdin/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -

Example: CLI - stdin

- - diff --git a/examples/cli-stdin/webpack.config.js b/examples/cli-stdin/webpack.config.js deleted file mode 100644 index 7316e8848c..0000000000 --- a/examples/cli-stdin/webpack.config.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -module.exports = { - context: __dirname, - entry: './app.js' -}; diff --git a/examples/cli/bonjour/README.md b/examples/cli/bonjour/README.md new file mode 100644 index 0000000000..30ed4dd0a0 --- /dev/null +++ b/examples/cli/bonjour/README.md @@ -0,0 +1,15 @@ +# Bounjour (ZeroConf) + +The Bounjour capability broadcasts server information via ZeroConf when the Server +is started. + +To run this example, run this command in your console or terminal: + +```console +node ../../bin/webpack-dev-server.js --bonjour +``` + +## What Should Happen + +A Zeroconf broadcast should occur, containing data with a type of `http` and a +subtype of `webpack`. diff --git a/examples/cli/bonjour/app.js b/examples/cli/bonjour/app.js new file mode 100644 index 0000000000..0b5f836ed8 --- /dev/null +++ b/examples/cli/bonjour/app.js @@ -0,0 +1,5 @@ +'use strict'; + +const target = document.querySelector('#target'); + +target.innerHTML = 'Please check your Zeroconf service.'; diff --git a/examples/hmr/webpack.config.js b/examples/cli/bonjour/webpack.config.js similarity index 81% rename from examples/hmr/webpack.config.js rename to examples/cli/bonjour/webpack.config.js index 009e0ca78e..58e922e044 100644 --- a/examples/hmr/webpack.config.js +++ b/examples/cli/bonjour/webpack.config.js @@ -2,7 +2,7 @@ // our setup function adds behind-the-scenes bits to the config that all of our // examples need -const { setup } = require('../util'); +const { setup } = require('../../util'); module.exports = setup({ context: __dirname, diff --git a/examples/hmr/README.md b/examples/cli/hmr/README.md similarity index 94% rename from examples/hmr/README.md rename to examples/cli/hmr/README.md index f505c9f3df..c89d6f8faa 100644 --- a/examples/hmr/README.md +++ b/examples/cli/hmr/README.md @@ -6,7 +6,7 @@ application is running, without a full reload of the page. To run this example, run this command in your console or terminal: ```console -node ../../bin/webpack-dev-server.js --open --hot +npm run webpack-dev-server -- --open --hot ``` ## What Should Happen diff --git a/examples/hmr/app.js b/examples/cli/hmr/app.js similarity index 100% rename from examples/hmr/app.js rename to examples/cli/hmr/app.js diff --git a/examples/hmr/example.js b/examples/cli/hmr/example.js similarity index 100% rename from examples/hmr/example.js rename to examples/cli/hmr/example.js diff --git a/examples/cli/hmr/webpack.config.js b/examples/cli/hmr/webpack.config.js new file mode 100644 index 0000000000..58e922e044 --- /dev/null +++ b/examples/cli/hmr/webpack.config.js @@ -0,0 +1,10 @@ +'use strict'; + +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ + context: __dirname, + entry: './app.js' +}); diff --git a/examples/cli/open-page/README.md b/examples/cli/open-page/README.md new file mode 100644 index 0000000000..f4c02f76cc --- /dev/null +++ b/examples/cli/open-page/README.md @@ -0,0 +1,14 @@ +# CLI: Open Page Option + +```console +npm run webpack-dev-server -- --open-page example.html#page1 +``` + +Some applications may consist of multiple pages. During development it may +be useful to directly open a particular page. The page to open may be specified +as the argument to the `open-page` option. + +## What Should Happen + +The script should open `http://localhost:8080/` in your default browser. +You should see the text on the page itself change to read `Success!`. diff --git a/examples/cli/open-page/app.js b/examples/cli/open-page/app.js new file mode 100644 index 0000000000..2570c6821c --- /dev/null +++ b/examples/cli/open-page/app.js @@ -0,0 +1,11 @@ +'use strict'; + +const target = document.querySelector('#target'); + +if (window.location.href.endsWith('example.html#page1')) { + target.classList.add('pass'); + target.innerHTML = 'Success!'; +} else { + target.classList.add('fail'); + target.innerHTML = 'Houston, we have a problem.'; +} diff --git a/examples/cli/open-page/webpack.config.js b/examples/cli/open-page/webpack.config.js new file mode 100644 index 0000000000..d9c3eaef2d --- /dev/null +++ b/examples/cli/open-page/webpack.config.js @@ -0,0 +1,18 @@ +'use strict'; + +const HtmlWebpackPlugin = require('html-webpack-plugin'); +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ + context: __dirname, + entry: './app.js', + plugins: [ + new HtmlWebpackPlugin({ + filename: 'example.html', + template: '../../assets/layout.html', + title: 'Open Page / Example' + }) + ] +}); diff --git a/examples/cli/public-protocol/README.md b/examples/cli/public-protocol/README.md new file mode 100644 index 0000000000..98c6cc5701 --- /dev/null +++ b/examples/cli/public-protocol/README.md @@ -0,0 +1,18 @@ +# CLI: Public Option Protocol + +```console +npm run webpack-dev-server +``` + +_NOTE: replace `` with your local IP Address._ + +You're now able to explicitly define the protocol used with the `public` option +(have a look to the config provided in `webpack.config.js`). + +## What Should Happen + +The script should open `http://localhost:8080/` in your default browser. + +You should see a failed attempt to establish a connection to `/sockjs-node` +via the explicitly defined `https://localhost:8080`. This fails of course since +we're not hosting https. diff --git a/examples/cli/public-protocol/app.js b/examples/cli/public-protocol/app.js new file mode 100644 index 0000000000..abdefa79cd --- /dev/null +++ b/examples/cli/public-protocol/app.js @@ -0,0 +1,5 @@ +'use strict'; + +const target = document.querySelector('#target'); + +target.innerHTML = 'Please check the sockjs-info request in devtools, it should try to connect to the protocol + server defined in the public setting.'; diff --git a/examples/cli-public-protocol/index.html b/examples/cli/public-protocol/index.html similarity index 100% rename from examples/cli-public-protocol/index.html rename to examples/cli/public-protocol/index.html diff --git a/examples/cli/public-protocol/webpack.config.js b/examples/cli/public-protocol/webpack.config.js new file mode 100644 index 0000000000..b8f5e8774c --- /dev/null +++ b/examples/cli/public-protocol/webpack.config.js @@ -0,0 +1,15 @@ +'use strict'; + +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ + context: __dirname, + entry: './app.js', + devServer: { + host: '0.0.0.0', + public: 'https://localhost:8080', + disableHostCheck: true + } +}); diff --git a/examples/cli/public/README.md b/examples/cli/public/README.md new file mode 100644 index 0000000000..fccb348bc2 --- /dev/null +++ b/examples/cli/public/README.md @@ -0,0 +1,21 @@ +# CLI: Public Option + +```console +npm run webpack-dev-server -- --open --host 0.0.0.0 --public :8080 +``` + +_NOTE: replace `` with your local IP Address._ + +In order to make the server publicly accessible the client needs to know with +what host to connect to the server. If `--host 0.0.0.0` is given, the client +would try to connect to `0.0.0.0`. With the `--public` options it is possible to +override this. + +## What Should Happen + +1. The script should open `http://0.0.0.0:8080/` in your default browser. +2. You should see the text on the page itself change to read `Success!`. +3. Open the console in your browser's devtools. +4. Select the 'Network' tab. +5. Select the 'WS' or 'WebSockets' sub-tab. +6. Verify that the WebSocket is connecting to `:8080`. diff --git a/examples/cli/public/app.js b/examples/cli/public/app.js new file mode 100644 index 0000000000..ae384858b9 --- /dev/null +++ b/examples/cli/public/app.js @@ -0,0 +1,6 @@ +'use strict'; + +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; diff --git a/examples/cli/public/webpack.config.js b/examples/cli/public/webpack.config.js new file mode 100644 index 0000000000..58e922e044 --- /dev/null +++ b/examples/cli/public/webpack.config.js @@ -0,0 +1,10 @@ +'use strict'; + +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ + context: __dirname, + entry: './app.js' +}); diff --git a/examples/cli/stdin/README.md b/examples/cli/stdin/README.md new file mode 100644 index 0000000000..e9364fa6a7 --- /dev/null +++ b/examples/cli/stdin/README.md @@ -0,0 +1,16 @@ +# CLI: Stdin Option + +Specifying this option instructs the server to close when `stdin` ends. + +```console +npm run webpack-dev-server -- --stdin +``` + +## What Should Happen + +1. The server should begin running. +2. Press `CTL+D` on your keyboard. +3. The server should close. + +_Note: the keyboard shortcut for terminating `stdin` can vary depending on the +operating systems._ diff --git a/examples/cli/stdin/app.js b/examples/cli/stdin/app.js new file mode 100644 index 0000000000..1c221afc42 --- /dev/null +++ b/examples/cli/stdin/app.js @@ -0,0 +1,5 @@ +'use strict'; + +const target = document.querySelector('#target'); + +target.innerHTML = 'Press CTL+D on your keyboard to close the server.'; diff --git a/examples/bonjour/webpack.config.js b/examples/cli/stdin/webpack.config.js similarity index 100% rename from examples/bonjour/webpack.config.js rename to examples/cli/stdin/webpack.config.js diff --git a/examples/node-api-middleware/README.md b/examples/node-api-middleware/README.md deleted file mode 100644 index f55fe05dd1..0000000000 --- a/examples/node-api-middleware/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# Node.js API - Middleware - -```shell -node server.js -``` - -Starts a webpack-dev-server setup via the Node API. Open `http://localhost:8080/` to go the app. - -## What should happen - -In the app you should see "It's working." - -In the CLI, you should see this for each refresh in the browser: - -``` -Using middleware for / -Using middleware for /bundle.js -``` diff --git a/examples/node-api-middleware/app.js b/examples/node-api-middleware/app.js deleted file mode 100644 index e45e577a65..0000000000 --- a/examples/node-api-middleware/app.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -document.write("It's working."); - -// This results in a warning: -if (!window) { - // eslint-disable-next-line - require(`./${window}parseable.js`); -} - -// This results in an error: -// if(!window) require("test"); diff --git a/examples/node-api-middleware/index.html b/examples/node-api-middleware/index.html deleted file mode 100644 index 234ba4590f..0000000000 --- a/examples/node-api-middleware/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -

Example: Node.js API - Middleware

- - diff --git a/examples/node-api-middleware/webpack.config.js b/examples/node-api-middleware/webpack.config.js deleted file mode 100644 index 93e493cd8a..0000000000 --- a/examples/node-api-middleware/webpack.config.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -module.exports = { - context: __dirname, - entry: ['./app.js', '../../client/index.js?http://localhost:8080/'], - output: { - filename: 'bundle.js' - } -}; diff --git a/examples/node-api-simple/README.md b/examples/node-api-simple/README.md deleted file mode 100644 index 1ce352b141..0000000000 --- a/examples/node-api-simple/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Node.js API - Simple - -```shell -node server.js -``` - -Starts a simple webpack-dev-server setup via the Node API. Open `http://localhost:8080/` to go the app. - -## What should happen - -In the app you should see "It's working." - -In `app.js`, uncomment the code that results in an error and save. This error should be visible in the CLI and devtools. - -Then, in `app.js`, uncomment the code that results in a warning. This warning should be visible in the CLI and devtools. diff --git a/examples/node-api-simple/index.html b/examples/node-api-simple/index.html deleted file mode 100644 index 0445fdf419..0000000000 --- a/examples/node-api-simple/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -

Example: Node.js API - Simple

- - diff --git a/examples/node-api-simple/webpack.config.js b/examples/node-api-simple/webpack.config.js deleted file mode 100644 index 93e493cd8a..0000000000 --- a/examples/node-api-simple/webpack.config.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -module.exports = { - context: __dirname, - entry: ['./app.js', '../../client/index.js?http://localhost:8080/'], - output: { - filename: 'bundle.js' - } -}; diff --git a/examples/util.js b/examples/util.js index 74571d1dd1..95fac81241 100644 --- a/examples/util.js +++ b/examples/util.js @@ -13,6 +13,7 @@ module.exports = { const defaults = { plugins: [], devServer: {} }; const result = Object.assign(defaults, config); const before = function before(app) { + console.log('\n\n\n\nbefore\n\n\n\n'); app.get('/assets/*', (req, res) => { const filename = path.join(__dirname, '/', req.path); res.sendFile(filename); @@ -55,7 +56,7 @@ module.exports = { result.plugins.push(new webpack.NamedModulesPlugin()); result.plugins.push(new HtmlWebpackPlugin({ filename: 'index.html', - template: '../assets/layout.html', + template: path.join(__dirname, 'assets/layout.html'), title: exampleTitle })); @@ -71,6 +72,8 @@ module.exports = { result.output = { path: path.dirname(module.parent.filename) }; + console.log(result); + return result; } }; diff --git a/lib/Server.js b/lib/Server.js index f2082413cc..e70a93a266 100644 --- a/lib/Server.js +++ b/lib/Server.js @@ -323,7 +323,11 @@ function Server(compiler, options) { }, before: () => { - if (typeof options.before === 'function') { options.before(app, this); } + console.log(options.before); + if (typeof options.before === 'function') { + console.log('before is function'); + options.before(app, this); + } }, middleware: () => { diff --git a/package.json b/package.json index c3f220c258..2bb81b4553 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "test": "npm run lint && npm run mocha", "build:live": "webpack ./client/live.js client/live.bundle.js --color --config client/webpack.config.js", "build:index": "webpack ./client/index.js client/index.bundle.js --color --config client/webpack.config.js", - "build:sockjs": "webpack ./client/sockjs.js client/sockjs.bundle.js --color --config client/webpack.sockjs.config.js" + "build:sockjs": "webpack ./client/sockjs.js client/sockjs.bundle.js --color --config client/webpack.sockjs.config.js", + "webpack-dev-server": "cd $INIT_CWD && node ../../../bin/webpack-dev-server.js" }, "files": [ "lib/", From ebf032456233447def5e92b8f74ef0ea47839d73 Mon Sep 17 00:00:00 2001 From: shellscape Date: Thu, 9 Nov 2017 11:09:16 -0500 Subject: [PATCH 4/7] moving / updating more examples fixed the root path of bundle.js in layout removed baddie console logs --- examples/README.md | 8 ++ examples/assets/layout.html | 4 +- examples/assets/style.css | 12 ++- examples/cli/bonjour/README.md | 2 +- examples/{ => cli}/compression/README.md | 2 +- examples/cli/compression/app.js | 6 ++ .../{ => cli}/compression/webpack.config.js | 2 +- examples/cli/history-api-fallback/README.md | 20 +++++ examples/cli/history-api-fallback/app.js | 75 +++++++++++++++++++ .../{ => cli}/history-api-fallback/file.txt | 0 .../history-api-fallback/webpack.config.js | 15 ++++ examples/cli/public/README.md | 2 +- examples/compression/app.js | 3 - examples/history-api-fallback/README.md | 15 ---- examples/history-api-fallback/app.js | 37 --------- examples/history-api-fallback/index.html | 28 ------- .../history-api-fallback/webpack.config.js | 11 --- examples/host-port/README.md | 4 +- examples/https/README.md | 4 +- examples/listen-socket/README.md | 2 +- examples/modus-iframe/README.md | 2 +- examples/modus-inline/README.md | 4 +- examples/modus-lazy/README.md | 2 +- examples/modus-manual-script/README.md | 4 +- examples/node-false/README.md | 2 +- examples/overlay-warnings/README.md | 2 +- examples/overlay/README.md | 2 +- examples/progress/README.md | 2 +- examples/promise-config/README.md | 2 +- examples/proxy-advanced/README.md | 2 +- examples/proxy-hot-reload/README.md | 2 +- examples/proxy-simple/README.md | 2 +- examples/util.js | 3 - examples/watch-content-base/README.md | 4 +- examples/webpack-config-array/README.md | 2 +- examples/webworker/README.md | 3 +- lib/Server.js | 2 - 37 files changed, 164 insertions(+), 130 deletions(-) rename examples/{ => cli}/compression/README.md (94%) create mode 100644 examples/cli/compression/app.js rename examples/{ => cli}/compression/webpack.config.js (81%) create mode 100644 examples/cli/history-api-fallback/README.md create mode 100644 examples/cli/history-api-fallback/app.js rename examples/{ => cli}/history-api-fallback/file.txt (100%) create mode 100644 examples/cli/history-api-fallback/webpack.config.js delete mode 100644 examples/compression/app.js delete mode 100644 examples/history-api-fallback/README.md delete mode 100644 examples/history-api-fallback/app.js delete mode 100644 examples/history-api-fallback/index.html delete mode 100644 examples/history-api-fallback/webpack.config.js diff --git a/examples/README.md b/examples/README.md index f87343610c..9283ae4740 100644 --- a/examples/README.md +++ b/examples/README.md @@ -11,6 +11,14 @@ An example should be as minimal as possible and consists of at least: - A description of what should happen when running the example. - A `wepack.config.js` file containing the `webpack` configuration for the example app. +## API versus CLI + +API examples can be found in the `api` directory. These examples demonstrate how +to access and run `webpack-dev-server` directly in your application / script. + +CLI exampes can be found in the `cli` directory. These examples demonstrate how +to run `webpack-dev-server` from the command line in your console / terminal. + ## Notes - Each example's `webpack` config is wrapped with `util.setup`; a helper function diff --git a/examples/assets/layout.html b/examples/assets/layout.html index 2c675125c9..006874d26a 100644 --- a/examples/assets/layout.html +++ b/examples/assets/layout.html @@ -1,7 +1,7 @@ - WDS Example: <%= htmlWebpackPlugin.options.title %> + WDS ▻ <%= htmlWebpackPlugin.options.title %> @@ -21,6 +21,6 @@

<%= htmlWebpackPlugin.options.title %>

- + diff --git a/examples/assets/style.css b/examples/assets/style.css index 1faa447900..f621329d6c 100644 --- a/examples/assets/style.css +++ b/examples/assets/style.css @@ -18,6 +18,16 @@ body { -moz-osx-font-smoothing: grayscale; } +a { + color: #2086d7; + text-decoration: none; + transition: color 250ms; +} + +a:hover { + color: #1a6aab; +} + main { width: 100%; max-width: 94.2rem; @@ -47,7 +57,7 @@ section { padding: 0 0 0 4.2rem; } -p, div { +div, p, table { font-size: 1.6rem; } diff --git a/examples/cli/bonjour/README.md b/examples/cli/bonjour/README.md index 30ed4dd0a0..c3433ff131 100644 --- a/examples/cli/bonjour/README.md +++ b/examples/cli/bonjour/README.md @@ -6,7 +6,7 @@ is started. To run this example, run this command in your console or terminal: ```console -node ../../bin/webpack-dev-server.js --bonjour +npm run webpack-dev-server -- --bonjour ``` ## What Should Happen diff --git a/examples/compression/README.md b/examples/cli/compression/README.md similarity index 94% rename from examples/compression/README.md rename to examples/cli/compression/README.md index 5c06a61039..6f21980f18 100644 --- a/examples/compression/README.md +++ b/examples/cli/compression/README.md @@ -6,7 +6,7 @@ to roughly 30% of its original size before the files are sent to the browser. To run this example, run this command in your console or terminal: ```console -node ../../bin/webpack-dev-server.js --open --compress +npm run webpack-dev-server -- --open --compress ``` ## What should happen diff --git a/examples/cli/compression/app.js b/examples/cli/compression/app.js new file mode 100644 index 0000000000..ae384858b9 --- /dev/null +++ b/examples/cli/compression/app.js @@ -0,0 +1,6 @@ +'use strict'; + +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; diff --git a/examples/compression/webpack.config.js b/examples/cli/compression/webpack.config.js similarity index 81% rename from examples/compression/webpack.config.js rename to examples/cli/compression/webpack.config.js index 009e0ca78e..58e922e044 100644 --- a/examples/compression/webpack.config.js +++ b/examples/cli/compression/webpack.config.js @@ -2,7 +2,7 @@ // our setup function adds behind-the-scenes bits to the config that all of our // examples need -const { setup } = require('../util'); +const { setup } = require('../../util'); module.exports = setup({ context: __dirname, diff --git a/examples/cli/history-api-fallback/README.md b/examples/cli/history-api-fallback/README.md new file mode 100644 index 0000000000..86251429ca --- /dev/null +++ b/examples/cli/history-api-fallback/README.md @@ -0,0 +1,20 @@ +# CLI: History API Fallback Option + +This option enables [History API Fallback](https://github.com/bripkens/connect-history-api-fallback) +support in `webpack-dev-server`, effectively asking the server to fallback to +`index.html` in the event that a requested resource cannot be found. + +```shell +npm run webpack-dev-server -- --open --history-api-fallback +``` + +_Note: some URLs don't work by default. For example; if the url contains a dot. +Be sure to checkout the [connect-history-api-fallback](https://github.com/bripkens/connect-history-api-fallback) +options._ + +## What Should Happen + +1. The script should open `http://0.0.0.0:8080/` in your default browser. +2. You should see text on the page that reads 'Current Path: /'. +3. Navigate to `http://localhost:8080/foo/bar`. +4. You should see text on the page that reads 'Current Path: /foo/background'. diff --git a/examples/cli/history-api-fallback/app.js b/examples/cli/history-api-fallback/app.js new file mode 100644 index 0000000000..29c5ea13d9 --- /dev/null +++ b/examples/cli/history-api-fallback/app.js @@ -0,0 +1,75 @@ +'use strict'; + +/* global XMLHttpRequest */ + +const path = document.location.pathname; +const target = document.querySelector('#target'); +const style = document.createElement('style'); +const css = `table { + border-radius: 0.3rem; + border: 0.1rem solid #474747; + border-spacing: 0; + padding: 0; + width: 50%; + } + + table td { + border-right: 0.1rem solid #474747; + padding: 0.5rem 1rem; + } + + table tr td:last-child { + border-right: 0; + text-align: center; + } + + table td.pass { + background: #f2f9f4; + color: #4db277; + } + + table td.fail { + background: #f2dede; + color: #a94442; + }`; + +style.appendChild(document.createTextNode(css)); +document.head.appendChild(style); +target.innerHTML = `Current Path: ${path}`; + +document.addEventListener('DOMContentLoaded', () => { + if (document.querySelector('#files')) { + return; + } + + const tests = [ + { url: '/', name: 'index', re: /^/i }, + { url: '/test', name: 'non-existent path', re: /^/i }, + { url: '/file.txt', name: 'existing path', re: /^file/ } + ]; + const table = document.createElement('table'); + const tbody = document.createElement('tbody'); + + table.id = 'files'; + table.appendChild(tbody); + target.parentNode.appendChild(table); + + tests.forEach((test) => { + const tr = document.createElement('tr'); + tbody.appendChild(tr); + check(test.url, test.re, (res) => { + tr.innerHTML = `${test.name}`; + tr.innerHTML += `${test.url}`; + tr.innerHTML += `${res}`; + }); + }); +}, true); + +function check(url, re, cb) { + const xhr = new XMLHttpRequest(); + xhr.addEventListener('load', () => { + cb(re.test(xhr.responseText) ? 'pass' : 'fail'); + }); + xhr.open('GET', url); + xhr.send(); +} diff --git a/examples/history-api-fallback/file.txt b/examples/cli/history-api-fallback/file.txt similarity index 100% rename from examples/history-api-fallback/file.txt rename to examples/cli/history-api-fallback/file.txt diff --git a/examples/cli/history-api-fallback/webpack.config.js b/examples/cli/history-api-fallback/webpack.config.js new file mode 100644 index 0000000000..1f0de4d0da --- /dev/null +++ b/examples/cli/history-api-fallback/webpack.config.js @@ -0,0 +1,15 @@ +'use strict'; + +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ + context: __dirname, + entry: './app.js', + devServer: { + historyApiFallback: { + disableDotRule: true + } + } +}); diff --git a/examples/cli/public/README.md b/examples/cli/public/README.md index fccb348bc2..3cf19d11d6 100644 --- a/examples/cli/public/README.md +++ b/examples/cli/public/README.md @@ -14,7 +14,7 @@ override this. ## What Should Happen 1. The script should open `http://0.0.0.0:8080/` in your default browser. -2. You should see the text on the page itself change to read `Success!`. +2. You should see the text on the page itself change to read `Success!`. 3. Open the console in your browser's devtools. 4. Select the 'Network' tab. 5. Select the 'WS' or 'WebSockets' sub-tab. diff --git a/examples/compression/app.js b/examples/compression/app.js deleted file mode 100644 index 7b9ea7ebaa..0000000000 --- a/examples/compression/app.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -document.write("It's working."); diff --git a/examples/history-api-fallback/README.md b/examples/history-api-fallback/README.md deleted file mode 100644 index ff16593b86..0000000000 --- a/examples/history-api-fallback/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# History API fallback - -```shell -node ../../bin/webpack-dev-server.js --open --history-api-fallback -``` - -Enables support for history API fallback, which means that a request will fallback to `/index.html` if no resource can be found. - -Note that by default, some URLs don't work. For example, if the url contains a dot. Be sure to checkout the [connect-history-api-fallback](https://github.com/bripkens/connect-history-api-fallback) options. - -## What should happen - -The script should open `http://localhost:8080/`, and you should see "It's working from path /". - -Go to `http://localhost:8080/foo/bar`. You should see "It's working from path /foo/bar". diff --git a/examples/history-api-fallback/app.js b/examples/history-api-fallback/app.js deleted file mode 100644 index 46ba7b2463..0000000000 --- a/examples/history-api-fallback/app.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -/* global XMLHttpRequest */ -const path = document.location.pathname; -document.write(`It's working from path ${path}`); - -document.addEventListener('DOMContentLoaded', () => { - const tests = [ - { url: '/', name: 'index', re: /^/ }, - { url: '/test', name: 'unexisting path', re: /^/ }, - { url: '/file.txt', name: 'existing path', re: /^file/ } - ]; - - const table = document.createElement('table'); - const tbody = document.createElement('tbody'); - table.appendChild(tbody); - document.body.appendChild(table); - - tests.forEach((test) => { - const tr = document.createElement('tr'); - tbody.appendChild(tr); - check(test.url, test.re, (res) => { - tr.innerHTML = `${test.name}`; - tr.innerHTML += `${test.url}`; - tr.innerHTML += `${res}`; - }); - }); -}); - -function check(url, re, cb) { - const xhr = new XMLHttpRequest(); - xhr.addEventListener('load', () => { - cb(re.test(xhr.responseText) ? 'ok' : 'error'); - }); - xhr.open('GET', url); - xhr.send(); -} diff --git a/examples/history-api-fallback/index.html b/examples/history-api-fallback/index.html deleted file mode 100644 index a653e1ba3a..0000000000 --- a/examples/history-api-fallback/index.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - -

Example: history API fallback

- - diff --git a/examples/history-api-fallback/webpack.config.js b/examples/history-api-fallback/webpack.config.js deleted file mode 100644 index 39550c30ac..0000000000 --- a/examples/history-api-fallback/webpack.config.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -module.exports = { - context: __dirname, - entry: './app.js', - devServer: { - historyApiFallback: { - disableDotRule: true - } - } -}; diff --git a/examples/host-port/README.md b/examples/host-port/README.md index 7f52f0a908..ca91131430 100644 --- a/examples/host-port/README.md +++ b/examples/host-port/README.md @@ -2,12 +2,12 @@ Only For ipv4 ```shell -node ../../bin/webpack-dev-server.js --open --port 5000 --host 0.0.0.0 +npm run webpack-dev-server -- --open --port 5000 --host 0.0.0.0 ``` For ipv6 support. (it also works with ipv4.) ```shell -node ../../bin/webpack-dev-server.js --open --port 5000 --host :: +npm run webpack-dev-server -- --open --port 5000 --host :: ``` We want to change the port to `5000`, and make the server publicly accessible. diff --git a/examples/https/README.md b/examples/https/README.md index facec5db59..c05ba4010d 100644 --- a/examples/https/README.md +++ b/examples/https/README.md @@ -14,7 +14,7 @@ following resources for doing so: ## Getting Started ```shell -node ../../bin/webpack-dev-server.js --open --https +npm run webpack-dev-server -- --open --https ``` ## Using Your Certificate @@ -22,7 +22,7 @@ node ../../bin/webpack-dev-server.js --open --https Options are available for using your own SSL Certificate in your preferred or OS-required format. -Given the base command `node ../../bin/webpack-dev-server.js --open --https`, append +Given the base command `npm run webpack-dev-server -- --open --https`, append one of the following: * (PEM Files) `--cert=../../ssl/server.pem --key=../../ssl/server.pem` diff --git a/examples/listen-socket/README.md b/examples/listen-socket/README.md index 9b79361c08..379a46f713 100644 --- a/examples/listen-socket/README.md +++ b/examples/listen-socket/README.md @@ -3,7 +3,7 @@ Start dev server in socket mode: ```shell -node ../../bin/webpack-dev-server.js --socket ./webpack.sock +npm run webpack-dev-server -- --socket ./webpack.sock ``` And then start node server that will use that socket: diff --git a/examples/modus-iframe/README.md b/examples/modus-iframe/README.md index 81b3f972c1..9e53eb161f 100644 --- a/examples/modus-iframe/README.md +++ b/examples/modus-iframe/README.md @@ -1,7 +1,7 @@ # Modus: iframe ```shell -node ../../bin/webpack-dev-server.js --no-inline --open +npm run webpack-dev-server -- --no-inline --open ``` The app is started in an iframe. The page contains the client script to connect to webpack-dev-server. diff --git a/examples/modus-inline/README.md b/examples/modus-inline/README.md index 5f577bc712..d547cad8f3 100644 --- a/examples/modus-inline/README.md +++ b/examples/modus-inline/README.md @@ -1,13 +1,13 @@ # Modus: inline ```shell -node ../../bin/webpack-dev-server.js --open +npm run webpack-dev-server -- --open ``` This opens the app in `inline` modus (which is the default). ```shell -node ../../bin/webpack-dev-server.js --open --config alternative.config.js +npm run webpack-dev-server -- --open --config alternative.config.js ``` This also opens the app in `inline` modus, but with a custom config. diff --git a/examples/modus-lazy/README.md b/examples/modus-lazy/README.md index b1899b3132..b5267a565a 100644 --- a/examples/modus-lazy/README.md +++ b/examples/modus-lazy/README.md @@ -1,7 +1,7 @@ # Modus: lazy ```shell -node ../../bin/webpack-dev-server.js --open --lazy --no-inline +npm run webpack-dev-server -- --open --lazy --no-inline ``` With the `lazy` modus, webpack-dev-server does **not** watch the files, automatically recompile them or refresh the browser. Instead, it only compiles after you manually refresh the page. diff --git a/examples/modus-manual-script/README.md b/examples/modus-manual-script/README.md index 8448bb2caf..aa878f95ec 100644 --- a/examples/modus-manual-script/README.md +++ b/examples/modus-manual-script/README.md @@ -1,13 +1,13 @@ # Modus: manual script ```shell -node ../../bin/webpack-dev-server.js --open --no-inline +npm run webpack-dev-server -- --open --no-inline ``` The webpack-dev-server client is added as script tag to the html page. ```shell -node ../../bin/webpack-dev-server.js --open --no-inline --https +npm run webpack-dev-server -- --open --no-inline --https ``` This will do the same, but connect over https. diff --git a/examples/node-false/README.md b/examples/node-false/README.md index 9085f7de8d..aaf030bea9 100644 --- a/examples/node-false/README.md +++ b/examples/node-false/README.md @@ -1,7 +1,7 @@ # CLI - node false ```shell -node ../../bin/webpack-dev-server.js --open +npm run webpack-dev-server -- --open ``` ## What should happen diff --git a/examples/overlay-warnings/README.md b/examples/overlay-warnings/README.md index 5996bd56c8..019463b4ea 100644 --- a/examples/overlay-warnings/README.md +++ b/examples/overlay-warnings/README.md @@ -1,7 +1,7 @@ # Overlay ```shell -node ../../bin/webpack-dev-server.js --open +npm run webpack-dev-server -- --open ``` ## What should happen diff --git a/examples/overlay/README.md b/examples/overlay/README.md index 2bda243ecc..1886f59662 100644 --- a/examples/overlay/README.md +++ b/examples/overlay/README.md @@ -1,7 +1,7 @@ # Overlay ```shell -node ../../bin/webpack-dev-server.js --open +npm run webpack-dev-server -- --open ``` ## What should happen diff --git a/examples/progress/README.md b/examples/progress/README.md index de22743c2d..57556674d5 100644 --- a/examples/progress/README.md +++ b/examples/progress/README.md @@ -1,7 +1,7 @@ # Status ```shell -node ../../bin/webpack-dev-server.js --open +npm run webpack-dev-server -- --open ``` ## What should happen diff --git a/examples/promise-config/README.md b/examples/promise-config/README.md index c3b9fa539f..cd26b3b258 100644 --- a/examples/promise-config/README.md +++ b/examples/promise-config/README.md @@ -1,7 +1,7 @@ # Promise-Based Config ```shell -node ../../bin/webpack-dev-server.js --open +npm run webpack-dev-server -- --open ``` ## What should happen diff --git a/examples/proxy-advanced/README.md b/examples/proxy-advanced/README.md index 3c7267b7da..635af99967 100644 --- a/examples/proxy-advanced/README.md +++ b/examples/proxy-advanced/README.md @@ -1,7 +1,7 @@ # Proxy: advanced ```shell -node ../../bin/webpack-dev-server.js --open +npm run webpack-dev-server -- --open ``` We want to proxy all urls that start with `/api` to `http://jsonplaceholder.typicode.com/`, but remove `/api` from the url. So `http://localhost:8080/api/users` should do a request to `http://jsonplaceholder.typicode.com/users`. diff --git a/examples/proxy-hot-reload/README.md b/examples/proxy-hot-reload/README.md index 028127012b..612a08687b 100644 --- a/examples/proxy-hot-reload/README.md +++ b/examples/proxy-hot-reload/README.md @@ -1,7 +1,7 @@ # Proxy: hot reload ```shell -node ../../bin/webpack-dev-server.js --open +npm run webpack-dev-server -- --open ``` Enables hot reloading for proxy config. If function is provided instead of diff --git a/examples/proxy-simple/README.md b/examples/proxy-simple/README.md index bcbc796f2d..87a77717e7 100644 --- a/examples/proxy-simple/README.md +++ b/examples/proxy-simple/README.md @@ -1,7 +1,7 @@ # Proxy: simple ```shell -node ../../bin/webpack-dev-server.js --open +npm run webpack-dev-server -- --open ``` In `webpack.config.js` there is a very simple configuration for a proxy. Note that this only works when proxying to a direct ip address. See the proxy-advanced example if you want to proxy to a domain. diff --git a/examples/util.js b/examples/util.js index 95fac81241..f003a72ad7 100644 --- a/examples/util.js +++ b/examples/util.js @@ -13,7 +13,6 @@ module.exports = { const defaults = { plugins: [], devServer: {} }; const result = Object.assign(defaults, config); const before = function before(app) { - console.log('\n\n\n\nbefore\n\n\n\n'); app.get('/assets/*', (req, res) => { const filename = path.join(__dirname, '/', req.path); res.sendFile(filename); @@ -72,8 +71,6 @@ module.exports = { result.output = { path: path.dirname(module.parent.filename) }; - console.log(result); - return result; } }; diff --git a/examples/watch-content-base/README.md b/examples/watch-content-base/README.md index a914cd1758..3cb9087a95 100644 --- a/examples/watch-content-base/README.md +++ b/examples/watch-content-base/README.md @@ -3,7 +3,7 @@ ## Watching a single directory ```shell -node ../../bin/webpack-dev-server.js --content-base assets --watch-content-base --open +npm run webpack-dev-server -- --content-base assets --watch-content-base --open ``` ### What should happen @@ -29,7 +29,7 @@ module.exports = { ``` ```shell -node ../../bin/webpack-dev-server.js --watch-content-base --open +npm run webpack-dev-server -- --watch-content-base --open ``` ### What should happen diff --git a/examples/webpack-config-array/README.md b/examples/webpack-config-array/README.md index d5c84c2fe0..c1f8825f06 100644 --- a/examples/webpack-config-array/README.md +++ b/examples/webpack-config-array/README.md @@ -1,7 +1,7 @@ # Webpack config array ```shell -node ../../bin/webpack-dev-server.js --open +npm run webpack-dev-server -- --open ``` This opens the app with two webpack configs. diff --git a/examples/webworker/README.md b/examples/webworker/README.md index 3caa6a7c52..d765e25036 100644 --- a/examples/webworker/README.md +++ b/examples/webworker/README.md @@ -4,7 +4,7 @@ ## How to run ```shell -node ../../bin/webpack-dev-server.js +npm run webpack-dev-server ``` @@ -16,4 +16,3 @@ node ../../bin/webpack-dev-server.js 4. The main thread posts the message in the console. No error, warning or other log traces should be in the console. - diff --git a/lib/Server.js b/lib/Server.js index e70a93a266..422679e4fd 100644 --- a/lib/Server.js +++ b/lib/Server.js @@ -323,9 +323,7 @@ function Server(compiler, options) { }, before: () => { - console.log(options.before); if (typeof options.before === 'function') { - console.log('before is function'); options.before(app, this); } }, From 9dba5c6a0a84ba3d02f188f8a00de554dd0eda6a Mon Sep 17 00:00:00 2001 From: shellscape Date: Thu, 9 Nov 2017 22:13:15 -0500 Subject: [PATCH 5/7] continuing examples upgrade --- examples/cli/host-and-port/README.md | 24 +++++++++++++++++++ examples/cli/host-and-port/app.js | 6 +++++ examples/cli/host-and-port/webpack.config.js | 10 ++++++++ examples/cli/lazy/README.md | 19 +++++++++++++++ examples/{modus-lazy => cli/lazy}/app.js | 5 +++- examples/cli/lazy/webpack.config.js | 10 ++++++++ examples/cli/node-false/README.md | 10 ++++++++ examples/cli/node-false/app.js | 6 +++++ examples/cli/node-false/webpack.config.js | 11 +++++++++ examples/host-port/README.md | 19 --------------- examples/host-port/app.js | 3 --- examples/host-port/index.html | 9 ------- examples/host-port/webpack.config.js | 6 ----- examples/https/app.js | 5 +++- examples/https/webpack.config.js | 8 +++++-- examples/listen-socket/app.js | 5 +++- examples/listen-socket/webpack.config.js | 8 +++++-- examples/modus-iframe/app.js | 5 +++- examples/modus-iframe/webpack.config.js | 8 +++++-- examples/modus-inline/README.md | 3 ++- examples/modus-inline/app.js | 5 +++- examples/modus-inline/webpack.config.js | 8 +++++-- examples/modus-lazy/README.md | 15 ------------ examples/modus-lazy/index.html | 9 ------- examples/modus-lazy/webpack.config.js | 6 ----- examples/modus-manual-script/app.js | 5 +++- .../modus-manual-script/webpack.config.js | 8 +++++-- examples/node-false/README.md | 9 ------- examples/node-false/app.js | 3 --- examples/node-false/index.html | 9 ------- examples/node-false/webpack.config.js | 7 ------ examples/overlay-warnings/app.js | 5 +++- examples/overlay-warnings/webpack.config.js | 8 +++++-- examples/overlay/app.js | 5 +++- examples/overlay/webpack.config.js | 8 +++++-- examples/progress/webpack.config.js | 8 +++++-- examples/promise-config/webpack.config.js | 8 +++++-- examples/proxy-advanced/README.md | 4 +++- examples/proxy-advanced/app.js | 5 +++- examples/proxy-advanced/webpack.config.js | 8 +++++-- examples/proxy-hot-reload/README.md | 4 +++- examples/proxy-hot-reload/app.js | 5 +++- examples/proxy-hot-reload/webpack.config.js | 8 +++++-- examples/proxy-simple/README.md | 4 +++- examples/proxy-simple/app.js | 5 +++- examples/proxy-simple/webpack.config.js | 8 +++++-- examples/watch-content-base/webpack.config.js | 8 +++++-- examples/webpack-config-array/README.md | 7 +++--- examples/webpack-config-array/app.js | 5 +++- .../webpack-config-array/webpack.config.js | 11 +++++---- examples/webworker/webpack.config.js | 8 +++++-- 51 files changed, 250 insertions(+), 146 deletions(-) create mode 100644 examples/cli/host-and-port/README.md create mode 100644 examples/cli/host-and-port/app.js create mode 100644 examples/cli/host-and-port/webpack.config.js create mode 100644 examples/cli/lazy/README.md rename examples/{modus-lazy => cli/lazy}/app.js (59%) create mode 100644 examples/cli/lazy/webpack.config.js create mode 100644 examples/cli/node-false/README.md create mode 100644 examples/cli/node-false/app.js create mode 100644 examples/cli/node-false/webpack.config.js delete mode 100644 examples/host-port/README.md delete mode 100644 examples/host-port/app.js delete mode 100644 examples/host-port/index.html delete mode 100644 examples/host-port/webpack.config.js delete mode 100644 examples/modus-lazy/README.md delete mode 100644 examples/modus-lazy/index.html delete mode 100644 examples/modus-lazy/webpack.config.js delete mode 100644 examples/node-false/README.md delete mode 100644 examples/node-false/app.js delete mode 100644 examples/node-false/index.html delete mode 100644 examples/node-false/webpack.config.js diff --git a/examples/cli/host-and-port/README.md b/examples/cli/host-and-port/README.md new file mode 100644 index 0000000000..8df4365423 --- /dev/null +++ b/examples/cli/host-and-port/README.md @@ -0,0 +1,24 @@ +# CLI: Host and Port Options + +You may choose to wish to change the host and port on which `webpack-dev-server` +will run. The `host` and `port` options allow for that. + +## IPv4 + +```console +npm run webpack-dev-server -- --open --port 5000 --host 0.0.0.0 +``` + +## IPv6 + +_This also works with IPv4_ + +```console +npm run webpack-dev-server -- --open --port 5000 --host :: +``` + +## What Should Happen + +1. The script should open `http://0.0.0.0:5000/` if specifying the IPv4 option, +or `http://[::]:5000/` for IPv6, in your default browser. +2. You should see the text on the page itself change to read `Success!`. diff --git a/examples/cli/host-and-port/app.js b/examples/cli/host-and-port/app.js new file mode 100644 index 0000000000..ae384858b9 --- /dev/null +++ b/examples/cli/host-and-port/app.js @@ -0,0 +1,6 @@ +'use strict'; + +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; diff --git a/examples/cli/host-and-port/webpack.config.js b/examples/cli/host-and-port/webpack.config.js new file mode 100644 index 0000000000..58e922e044 --- /dev/null +++ b/examples/cli/host-and-port/webpack.config.js @@ -0,0 +1,10 @@ +'use strict'; + +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ + context: __dirname, + entry: './app.js' +}); diff --git a/examples/cli/lazy/README.md b/examples/cli/lazy/README.md new file mode 100644 index 0000000000..2547ffab4f --- /dev/null +++ b/examples/cli/lazy/README.md @@ -0,0 +1,19 @@ +# CLI: Lazy Option + +With the `lazy` option enabled, `webpack-dev-server` does **not** watch the +bundle files, nor does it automatically recompile them or refresh the browser. +Instead, it only compiles after you manually refresh the page. + +```shell +npm run webpack-dev-server -- --open --lazy --no-inline +``` + +## What should happen + +1. The script should open `http://localhost:8080/` in your default browser. +2. You should see the text on the page itself change to read `Success!`. +3. Change something in `app.js` and save. +4. You should not see any changes in the console/terminal output. +5. You should not see any changes in the browser. +6. Refresh the page. +7. You should see compilation in the console/terminal and changes in the browser. diff --git a/examples/modus-lazy/app.js b/examples/cli/lazy/app.js similarity index 59% rename from examples/modus-lazy/app.js rename to examples/cli/lazy/app.js index 0c6feed6c2..bc127811c7 100644 --- a/examples/modus-lazy/app.js +++ b/examples/cli/lazy/app.js @@ -1,6 +1,9 @@ 'use strict'; -document.write("It's working."); +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; // This results in a warning: // if(!window) require("./" + window + "parseable.js"); diff --git a/examples/cli/lazy/webpack.config.js b/examples/cli/lazy/webpack.config.js new file mode 100644 index 0000000000..58e922e044 --- /dev/null +++ b/examples/cli/lazy/webpack.config.js @@ -0,0 +1,10 @@ +'use strict'; + +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ + context: __dirname, + entry: './app.js' +}); diff --git a/examples/cli/node-false/README.md b/examples/cli/node-false/README.md new file mode 100644 index 0000000000..ed0f6022b2 --- /dev/null +++ b/examples/cli/node-false/README.md @@ -0,0 +1,10 @@ +# CLI: Webpack `node` Option + +```shell +npm run webpack-dev-server -- --open +``` + +## What should happen + +1. The script should open `http://localhost:8080/` in your default browser. +2. You should see the text on the page itself change to read `Success!`. diff --git a/examples/cli/node-false/app.js b/examples/cli/node-false/app.js new file mode 100644 index 0000000000..ae384858b9 --- /dev/null +++ b/examples/cli/node-false/app.js @@ -0,0 +1,6 @@ +'use strict'; + +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; diff --git a/examples/cli/node-false/webpack.config.js b/examples/cli/node-false/webpack.config.js new file mode 100644 index 0000000000..2d66554e55 --- /dev/null +++ b/examples/cli/node-false/webpack.config.js @@ -0,0 +1,11 @@ +'use strict'; + +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ + context: __dirname, + entry: './app.js', + node: false +}); diff --git a/examples/host-port/README.md b/examples/host-port/README.md deleted file mode 100644 index ca91131430..0000000000 --- a/examples/host-port/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# host and port - -Only For ipv4 -```shell -npm run webpack-dev-server -- --open --port 5000 --host 0.0.0.0 -``` - -For ipv6 support. (it also works with ipv4.) -```shell -npm run webpack-dev-server -- --open --port 5000 --host :: -``` - -We want to change the port to `5000`, and make the server publicly accessible. - -## What should happen - -The script should open `http://0.0.0.0:5000/`(ipv4) or `http://[::]:5000/`(ipv6). You should see "It's working." - -Get your local ip (e.g. `192.168.1.40`), and try it from `192.168.1.40:5000`. Make sure your firewall doesn't block this port. diff --git a/examples/host-port/app.js b/examples/host-port/app.js deleted file mode 100644 index 7b9ea7ebaa..0000000000 --- a/examples/host-port/app.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -document.write("It's working."); diff --git a/examples/host-port/index.html b/examples/host-port/index.html deleted file mode 100644 index cfd4b2c045..0000000000 --- a/examples/host-port/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -

Example: host and port

- - diff --git a/examples/host-port/webpack.config.js b/examples/host-port/webpack.config.js deleted file mode 100644 index 7316e8848c..0000000000 --- a/examples/host-port/webpack.config.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -module.exports = { - context: __dirname, - entry: './app.js' -}; diff --git a/examples/https/app.js b/examples/https/app.js index 7b9ea7ebaa..ae384858b9 100644 --- a/examples/https/app.js +++ b/examples/https/app.js @@ -1,3 +1,6 @@ 'use strict'; -document.write("It's working."); +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; diff --git a/examples/https/webpack.config.js b/examples/https/webpack.config.js index 7316e8848c..58e922e044 100644 --- a/examples/https/webpack.config.js +++ b/examples/https/webpack.config.js @@ -1,6 +1,10 @@ 'use strict'; -module.exports = { +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ context: __dirname, entry: './app.js' -}; +}); diff --git a/examples/listen-socket/app.js b/examples/listen-socket/app.js index 7b9ea7ebaa..ae384858b9 100644 --- a/examples/listen-socket/app.js +++ b/examples/listen-socket/app.js @@ -1,3 +1,6 @@ 'use strict'; -document.write("It's working."); +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; diff --git a/examples/listen-socket/webpack.config.js b/examples/listen-socket/webpack.config.js index 7316e8848c..58e922e044 100644 --- a/examples/listen-socket/webpack.config.js +++ b/examples/listen-socket/webpack.config.js @@ -1,6 +1,10 @@ 'use strict'; -module.exports = { +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ context: __dirname, entry: './app.js' -}; +}); diff --git a/examples/modus-iframe/app.js b/examples/modus-iframe/app.js index 0c6feed6c2..bc127811c7 100644 --- a/examples/modus-iframe/app.js +++ b/examples/modus-iframe/app.js @@ -1,6 +1,9 @@ 'use strict'; -document.write("It's working."); +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; // This results in a warning: // if(!window) require("./" + window + "parseable.js"); diff --git a/examples/modus-iframe/webpack.config.js b/examples/modus-iframe/webpack.config.js index 7316e8848c..58e922e044 100644 --- a/examples/modus-iframe/webpack.config.js +++ b/examples/modus-iframe/webpack.config.js @@ -1,6 +1,10 @@ 'use strict'; -module.exports = { +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ context: __dirname, entry: './app.js' -}; +}); diff --git a/examples/modus-inline/README.md b/examples/modus-inline/README.md index d547cad8f3..c2b4206cf4 100644 --- a/examples/modus-inline/README.md +++ b/examples/modus-inline/README.md @@ -14,7 +14,8 @@ This also opens the app in `inline` modus, but with a custom config. ## What should happen -The script should open `http://localhost:8080/`. It should display "It's working" with a dotted background. +1. The script should open `http://localhost:8080/` in your default browser. +2. You should see the text on the page itself change to read `Success!`. In `app.js`, uncomment the code that results in an error and save. This error should be visible in the CLI and devtools. diff --git a/examples/modus-inline/app.js b/examples/modus-inline/app.js index 1f541b00d1..30895930f6 100644 --- a/examples/modus-inline/app.js +++ b/examples/modus-inline/app.js @@ -2,7 +2,10 @@ require('./style.less'); -document.write("It's working."); +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; // This results in a warning: // if(!window) require("./" + window + "parseable.js"); diff --git a/examples/modus-inline/webpack.config.js b/examples/modus-inline/webpack.config.js index 85a1dca10a..d8747b9f8b 100644 --- a/examples/modus-inline/webpack.config.js +++ b/examples/modus-inline/webpack.config.js @@ -1,6 +1,10 @@ 'use strict'; -module.exports = { +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ context: __dirname, entry: './app.js', module: { @@ -20,4 +24,4 @@ module.exports = { } ] } -}; +}); diff --git a/examples/modus-lazy/README.md b/examples/modus-lazy/README.md deleted file mode 100644 index b5267a565a..0000000000 --- a/examples/modus-lazy/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Modus: lazy - -```shell -npm run webpack-dev-server -- --open --lazy --no-inline -``` - -With the `lazy` modus, webpack-dev-server does **not** watch the files, automatically recompile them or refresh the browser. Instead, it only compiles after you manually refresh the page. - -## What should happen - -The script should open `http://localhost:8080/`. You should see "It's working." - -Change something in `app.js` and save. Check that in the CLI, nothing changed. Also check that in the browser, the old content is still displayed. - -Now refresh the app. The CLI should now compile. In the app you should now see the new content. diff --git a/examples/modus-lazy/index.html b/examples/modus-lazy/index.html deleted file mode 100644 index 17b57bff55..0000000000 --- a/examples/modus-lazy/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -

Example: modus - lazy

- - diff --git a/examples/modus-lazy/webpack.config.js b/examples/modus-lazy/webpack.config.js deleted file mode 100644 index 7316e8848c..0000000000 --- a/examples/modus-lazy/webpack.config.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -module.exports = { - context: __dirname, - entry: './app.js' -}; diff --git a/examples/modus-manual-script/app.js b/examples/modus-manual-script/app.js index 0c6feed6c2..bc127811c7 100644 --- a/examples/modus-manual-script/app.js +++ b/examples/modus-manual-script/app.js @@ -1,6 +1,9 @@ 'use strict'; -document.write("It's working."); +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; // This results in a warning: // if(!window) require("./" + window + "parseable.js"); diff --git a/examples/modus-manual-script/webpack.config.js b/examples/modus-manual-script/webpack.config.js index 7316e8848c..58e922e044 100644 --- a/examples/modus-manual-script/webpack.config.js +++ b/examples/modus-manual-script/webpack.config.js @@ -1,6 +1,10 @@ 'use strict'; -module.exports = { +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ context: __dirname, entry: './app.js' -}; +}); diff --git a/examples/node-false/README.md b/examples/node-false/README.md deleted file mode 100644 index aaf030bea9..0000000000 --- a/examples/node-false/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# CLI - node false - -```shell -npm run webpack-dev-server -- --open -``` - -## What should happen - -In the app you should see "It's working." diff --git a/examples/node-false/app.js b/examples/node-false/app.js deleted file mode 100644 index 7b9ea7ebaa..0000000000 --- a/examples/node-false/app.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -document.write("It's working."); diff --git a/examples/node-false/index.html b/examples/node-false/index.html deleted file mode 100644 index 0a665bff12..0000000000 --- a/examples/node-false/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -

Example: CLI - node false

- - diff --git a/examples/node-false/webpack.config.js b/examples/node-false/webpack.config.js deleted file mode 100644 index ace056d945..0000000000 --- a/examples/node-false/webpack.config.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -module.exports = { - context: __dirname, - entry: './app.js', - node: false -}; diff --git a/examples/overlay-warnings/app.js b/examples/overlay-warnings/app.js index 7bcebebed5..c1c6a4931a 100644 --- a/examples/overlay-warnings/app.js +++ b/examples/overlay-warnings/app.js @@ -1,6 +1,9 @@ 'use strict'; -document.write("It's working."); +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; // This results in a warning: // require("./casesensitive.js"); diff --git a/examples/overlay-warnings/webpack.config.js b/examples/overlay-warnings/webpack.config.js index 478c6290df..a84f2ac9e7 100644 --- a/examples/overlay-warnings/webpack.config.js +++ b/examples/overlay-warnings/webpack.config.js @@ -1,6 +1,10 @@ 'use strict'; -module.exports = { +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ context: __dirname, entry: './app.js', devServer: { @@ -9,4 +13,4 @@ module.exports = { warnings: true } } -}; +}); diff --git a/examples/overlay/app.js b/examples/overlay/app.js index 25efd99a02..f5e44a9844 100644 --- a/examples/overlay/app.js +++ b/examples/overlay/app.js @@ -1,6 +1,9 @@ 'use strict'; -document.write("It's working."); +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; // This results in an error: // if(!window) require("test"); diff --git a/examples/overlay/webpack.config.js b/examples/overlay/webpack.config.js index e690ecb913..a2dc62f1e8 100644 --- a/examples/overlay/webpack.config.js +++ b/examples/overlay/webpack.config.js @@ -1,9 +1,13 @@ 'use strict'; -module.exports = { +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ context: __dirname, entry: './app.js', devServer: { overlay: true } -}; +}); diff --git a/examples/progress/webpack.config.js b/examples/progress/webpack.config.js index a21a9875d4..3b88aceba5 100644 --- a/examples/progress/webpack.config.js +++ b/examples/progress/webpack.config.js @@ -1,9 +1,13 @@ 'use strict'; -module.exports = { +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ context: __dirname, entry: './app.js', devServer: { progress: true } -}; +}); diff --git a/examples/promise-config/webpack.config.js b/examples/promise-config/webpack.config.js index 5f8c0b8973..7f5f3e900b 100644 --- a/examples/promise-config/webpack.config.js +++ b/examples/promise-config/webpack.config.js @@ -1,10 +1,14 @@ 'use strict'; +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + module.exports = new Promise(((resolve) => { - resolve({ + resolve(setup({ context: __dirname, entry: './app.js', devServer: { } - }); + })); })); diff --git a/examples/proxy-advanced/README.md b/examples/proxy-advanced/README.md index 635af99967..676f5dc5ed 100644 --- a/examples/proxy-advanced/README.md +++ b/examples/proxy-advanced/README.md @@ -8,7 +8,9 @@ We want to proxy all urls that start with `/api` to `http://jsonplaceholder.typi ## What should happen -The script should open `http://localhost:8080/`. It should show "It's working." +1. The script should open `http://localhost:8080/` in your default browser. +2. You should see the text on the page itself change to read `Success!`. + Go to `http://localhost:8080/api/users`. It should show a couple of JSON objects. diff --git a/examples/proxy-advanced/app.js b/examples/proxy-advanced/app.js index 7b9ea7ebaa..ae384858b9 100644 --- a/examples/proxy-advanced/app.js +++ b/examples/proxy-advanced/app.js @@ -1,3 +1,6 @@ 'use strict'; -document.write("It's working."); +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; diff --git a/examples/proxy-advanced/webpack.config.js b/examples/proxy-advanced/webpack.config.js index 569be583f2..37dd071360 100644 --- a/examples/proxy-advanced/webpack.config.js +++ b/examples/proxy-advanced/webpack.config.js @@ -1,6 +1,10 @@ 'use strict'; -module.exports = { +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ context: __dirname, entry: './app.js', devServer: { @@ -19,4 +23,4 @@ module.exports = { } } } -}; +}); diff --git a/examples/proxy-hot-reload/README.md b/examples/proxy-hot-reload/README.md index 612a08687b..486dddf596 100644 --- a/examples/proxy-hot-reload/README.md +++ b/examples/proxy-hot-reload/README.md @@ -9,7 +9,9 @@ object, dev server calls it on each request to get proxy config and replaces pro ## What should happen -The script should open `http://localhost:8080/`. It should show "It's working." +1. The script should open `http://localhost:8080/` in your default browser. +2. You should see the text on the page itself change to read `Success!`. + Go to `http://localhost:8080/api/users`. It should show a couple of JSON objects. diff --git a/examples/proxy-hot-reload/app.js b/examples/proxy-hot-reload/app.js index 7b9ea7ebaa..ae384858b9 100644 --- a/examples/proxy-hot-reload/app.js +++ b/examples/proxy-hot-reload/app.js @@ -1,3 +1,6 @@ 'use strict'; -document.write("It's working."); +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; diff --git a/examples/proxy-hot-reload/webpack.config.js b/examples/proxy-hot-reload/webpack.config.js index d35b92322e..6a3b60f9bd 100644 --- a/examples/proxy-hot-reload/webpack.config.js +++ b/examples/proxy-hot-reload/webpack.config.js @@ -30,7 +30,11 @@ fs.watch('./proxy-config.js', () => { } }); -module.exports = { +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ context: __dirname, entry: './app.js', devServer: { @@ -40,4 +44,4 @@ module.exports = { } ] } -}; +}); diff --git a/examples/proxy-simple/README.md b/examples/proxy-simple/README.md index 87a77717e7..7e94efb46f 100644 --- a/examples/proxy-simple/README.md +++ b/examples/proxy-simple/README.md @@ -8,6 +8,8 @@ In `webpack.config.js` there is a very simple configuration for a proxy. Note th ## What should happen -The script should open `http://localhost:8080/`. It should show "It's working." +1. The script should open `http://localhost:8080/` in your default browser. +2. You should see the text on the page itself change to read `Success!`. + Browse to `http://localhost:8080/api/hey`. Since the proxy target does not actually exist, the CLI should give the error `[HPM] PROXY ERROR: ECONNREFUSED. localhost -> http://127.0.0.1:50545/api/hey`. diff --git a/examples/proxy-simple/app.js b/examples/proxy-simple/app.js index 7b9ea7ebaa..ae384858b9 100644 --- a/examples/proxy-simple/app.js +++ b/examples/proxy-simple/app.js @@ -1,3 +1,6 @@ 'use strict'; -document.write("It's working."); +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; diff --git a/examples/proxy-simple/webpack.config.js b/examples/proxy-simple/webpack.config.js index 08e51cb80c..cd56263c60 100644 --- a/examples/proxy-simple/webpack.config.js +++ b/examples/proxy-simple/webpack.config.js @@ -1,6 +1,10 @@ 'use strict'; -module.exports = { +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ context: __dirname, entry: './app.js', devServer: { @@ -8,4 +12,4 @@ module.exports = { '/api': 'http://127.0.0.1:50545' } } -}; +}); diff --git a/examples/watch-content-base/webpack.config.js b/examples/watch-content-base/webpack.config.js index 82e7265169..7636b79213 100644 --- a/examples/watch-content-base/webpack.config.js +++ b/examples/watch-content-base/webpack.config.js @@ -1,6 +1,10 @@ 'use strict'; -module.exports = { +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + +module.exports = setup({ context: __dirname, entry: './app.js', devServer: { @@ -9,4 +13,4 @@ module.exports = { 'css' ] } -}; +}); diff --git a/examples/webpack-config-array/README.md b/examples/webpack-config-array/README.md index c1f8825f06..dc532e6a77 100644 --- a/examples/webpack-config-array/README.md +++ b/examples/webpack-config-array/README.md @@ -8,6 +8,7 @@ This opens the app with two webpack configs. ## What should happen -The script should open `http://localhost:8080/`. It should display "It's working" with a dotted background. - -Browsing to `http://localhost:8080/bundle2.js` should show a minified JS bundle. +1. The script should open `http://localhost:8080/` in your default browser. +2. You should see the text on the page itself change to read `Success!`. +3. Navigate to `http://localhost:8080/bundle2.js` +4. The browser should display a minified JavaScript bundle. diff --git a/examples/webpack-config-array/app.js b/examples/webpack-config-array/app.js index 1f541b00d1..30895930f6 100644 --- a/examples/webpack-config-array/app.js +++ b/examples/webpack-config-array/app.js @@ -2,7 +2,10 @@ require('./style.less'); -document.write("It's working."); +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; // This results in a warning: // if(!window) require("./" + window + "parseable.js"); diff --git a/examples/webpack-config-array/webpack.config.js b/examples/webpack-config-array/webpack.config.js index 54a68018e0..9a0408dbda 100644 --- a/examples/webpack-config-array/webpack.config.js +++ b/examples/webpack-config-array/webpack.config.js @@ -1,9 +1,12 @@ 'use strict'; const webpack = require('webpack'); +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); module.exports = [ - { + setup({ context: __dirname, entry: './app.js', module: { @@ -23,8 +26,8 @@ module.exports = [ } ] } - }, - { + }), + setup({ context: __dirname, entry: './app.js', output: { @@ -50,5 +53,5 @@ module.exports = [ plugins: [ new webpack.optimize.UglifyJsPlugin() ] - } + }) ]; diff --git a/examples/webworker/webpack.config.js b/examples/webworker/webpack.config.js index 4b9f8d4ee8..ffe6f9cc21 100644 --- a/examples/webworker/webpack.config.js +++ b/examples/webworker/webpack.config.js @@ -1,7 +1,11 @@ 'use strict'; +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); + module.exports = [ - { + setup({ devtool: 'source-map', target: 'web', entry: './web.js', @@ -9,7 +13,7 @@ module.exports = [ filename: 'web.bundle.js', path: __dirname } - }, + }), { devtool: 'source-map', target: 'webworker', From 8fcd510317f2e626d5281137074564d0115e4cc5 Mon Sep 17 00:00:00 2001 From: shellscape Date: Thu, 9 Nov 2017 23:54:13 -0500 Subject: [PATCH 6/7] wraping up examples update --- examples/{assets => .assets}/favicon.ico | Bin .../{assets => .assets}/geomanist-medium.woff | Bin .../geomanist-medium.woff2 | Bin examples/{assets => .assets}/icon-square.svg | 0 examples/{assets => .assets}/layout.html | 6 +-- examples/{assets => .assets}/style.css | 0 examples/cli/default/README.md | 25 +++++++++++ .../default}/app.js | 6 +++ .../{modus-inline => cli/default}/pixels.png | Bin .../{modus-inline => cli/default}/style.less | 0 .../{modus-inline => cli/default}/svg.svg | 0 .../default}/webpack.config.js | 0 examples/{ => cli}/https/README.md | 2 +- examples/{ => cli}/https/app.js | 0 examples/{ => cli}/https/test_cert.pfx | Bin examples/{ => cli}/https/webpack.config.js | 0 examples/cli/iframe/README.md | 19 ++++++++ examples/{modus-iframe => cli/iframe}/app.js | 0 .../iframe}/webpack.config.js | 0 examples/{ => cli}/listen-socket/README.md | 23 ++++++---- examples/{ => cli}/listen-socket/app.js | 0 .../{ => cli}/listen-socket/check-socket.js | 0 .../listen-socket}/webpack.config.js | 0 examples/cli/overlay/README.md | 18 ++++++++ examples/{ => cli}/overlay/app.js | 0 .../overlay}/webpack.config.js | 0 examples/cli/progress/README.md | 12 +++++ .../{proxy-advanced => cli/progress}/app.js | 0 examples/{ => cli}/progress/webpack.config.js | 0 examples/cli/watch-content-base/README.md | 42 ++++++++++++++++++ .../watch-content-base}/app.js | 0 .../watch-content-base/assets/index.html | 0 .../watch-content-base/css/styles.css | 0 .../watch-content-base/webpack.config.js | 0 .../config-array}/README.md | 10 ++--- .../config-array}/app.js | 0 .../config-array}/pixels.png | Bin .../config-array}/style.less | 0 .../config-array}/svg.svg | 0 .../config-array}/webpack.config.js | 0 examples/general/config-promise/README.md | 13 ++++++ .../config-promise}/app.js | 0 .../config-promise}/index.html | 0 .../config-promise}/webpack.config.js | 0 examples/general/proxy-advanced/README.md | 19 ++++++++ .../proxy-advanced}/app.js | 0 .../{ => general}/proxy-advanced/bypass.html | 0 .../proxy-advanced/webpack.config.js | 0 .../{ => general}/proxy-hot-reload/README.md | 14 +++--- examples/general/proxy-hot-reload/app.js | 6 +++ .../proxy-hot-reload/proxy-config.js | 0 .../proxy-hot-reload/webpack.config.js | 0 examples/{ => general}/proxy-simple/README.md | 13 +++--- examples/general/proxy-simple/app.js | 6 +++ .../proxy-simple/webpack.config.js | 0 examples/{ => general}/webworker/README.md | 8 ++-- examples/{ => general}/webworker/web.js | 0 .../{ => general}/webworker/webpack.config.js | 6 +-- examples/{ => general}/webworker/worker.js | 0 examples/https/index.html | 9 ---- examples/modus-iframe/README.md | 15 ------- examples/modus-iframe/index.html | 9 ---- examples/modus-inline/README.md | 24 ---------- examples/modus-inline/index.html | 11 ----- examples/modus-manual-script/README.md | 21 --------- examples/modus-manual-script/app.js | 12 ----- examples/modus-manual-script/index.html | 10 ----- examples/overlay-warnings/README.md | 11 ----- examples/overlay-warnings/app.js | 13 ------ examples/overlay-warnings/caseSensitive.js | 3 -- examples/overlay-warnings/index.html | 9 ---- examples/overlay-warnings/webpack.config.js | 16 ------- examples/overlay/README.md | 11 ----- examples/overlay/index.html | 9 ---- examples/overlay/webpack.config.js | 13 ------ examples/progress/README.md | 11 ----- examples/progress/app.js | 5 --- examples/progress/index.html | 10 ----- examples/promise-config/README.md | 9 ---- examples/proxy-advanced/README.md | 17 ------- examples/proxy-advanced/index.html | 9 ---- examples/proxy-hot-reload/index.html | 10 ----- examples/proxy-simple/index.html | 9 ---- examples/util.js | 4 +- examples/watch-content-base/README.md | 41 ----------------- examples/watch-content-base/app.js | 4 -- examples/webpack-config-array/index.html | 9 ---- examples/webworker/index.html | 10 ----- 88 files changed, 211 insertions(+), 381 deletions(-) rename examples/{assets => .assets}/favicon.ico (100%) rename examples/{assets => .assets}/geomanist-medium.woff (100%) rename examples/{assets => .assets}/geomanist-medium.woff2 (100%) rename examples/{assets => .assets}/icon-square.svg (100%) rename examples/{assets => .assets}/layout.html (77%) rename examples/{assets => .assets}/style.css (100%) create mode 100644 examples/cli/default/README.md rename examples/{webpack-config-array => cli/default}/app.js (70%) rename examples/{modus-inline => cli/default}/pixels.png (100%) rename examples/{modus-inline => cli/default}/style.less (100%) rename examples/{modus-inline => cli/default}/svg.svg (100%) rename examples/{modus-inline => cli/default}/webpack.config.js (100%) rename examples/{ => cli}/https/README.md (98%) rename examples/{ => cli}/https/app.js (100%) rename examples/{ => cli}/https/test_cert.pfx (100%) rename examples/{ => cli}/https/webpack.config.js (100%) create mode 100644 examples/cli/iframe/README.md rename examples/{modus-iframe => cli/iframe}/app.js (100%) rename examples/{listen-socket => cli/iframe}/webpack.config.js (100%) rename examples/{ => cli}/listen-socket/README.md (64%) rename examples/{ => cli}/listen-socket/app.js (100%) rename examples/{ => cli}/listen-socket/check-socket.js (100%) rename examples/{modus-iframe => cli/listen-socket}/webpack.config.js (100%) create mode 100644 examples/cli/overlay/README.md rename examples/{ => cli}/overlay/app.js (100%) rename examples/{modus-manual-script => cli/overlay}/webpack.config.js (100%) create mode 100644 examples/cli/progress/README.md rename examples/{proxy-advanced => cli/progress}/app.js (100%) rename examples/{ => cli}/progress/webpack.config.js (100%) create mode 100644 examples/cli/watch-content-base/README.md rename examples/{proxy-hot-reload => cli/watch-content-base}/app.js (100%) rename examples/{ => cli}/watch-content-base/assets/index.html (100%) rename examples/{ => cli}/watch-content-base/css/styles.css (100%) rename examples/{ => cli}/watch-content-base/webpack.config.js (100%) rename examples/{webpack-config-array => general/config-array}/README.md (67%) rename examples/{modus-inline => general/config-array}/app.js (100%) rename examples/{webpack-config-array => general/config-array}/pixels.png (100%) rename examples/{webpack-config-array => general/config-array}/style.less (100%) rename examples/{webpack-config-array => general/config-array}/svg.svg (100%) rename examples/{webpack-config-array => general/config-array}/webpack.config.js (100%) create mode 100644 examples/general/config-promise/README.md rename examples/{promise-config => general/config-promise}/app.js (100%) rename examples/{promise-config => general/config-promise}/index.html (100%) rename examples/{promise-config => general/config-promise}/webpack.config.js (100%) create mode 100644 examples/general/proxy-advanced/README.md rename examples/{proxy-simple => general/proxy-advanced}/app.js (100%) rename examples/{ => general}/proxy-advanced/bypass.html (100%) rename examples/{ => general}/proxy-advanced/webpack.config.js (100%) rename examples/{ => general}/proxy-hot-reload/README.md (66%) create mode 100644 examples/general/proxy-hot-reload/app.js rename examples/{ => general}/proxy-hot-reload/proxy-config.js (100%) rename examples/{ => general}/proxy-hot-reload/webpack.config.js (100%) rename examples/{ => general}/proxy-simple/README.md (57%) create mode 100644 examples/general/proxy-simple/app.js rename examples/{ => general}/proxy-simple/webpack.config.js (100%) rename examples/{ => general}/webworker/README.md (73%) rename examples/{ => general}/webworker/web.js (100%) rename examples/{ => general}/webworker/webpack.config.js (80%) rename examples/{ => general}/webworker/worker.js (100%) delete mode 100644 examples/https/index.html delete mode 100644 examples/modus-iframe/README.md delete mode 100644 examples/modus-iframe/index.html delete mode 100644 examples/modus-inline/README.md delete mode 100644 examples/modus-inline/index.html delete mode 100644 examples/modus-manual-script/README.md delete mode 100644 examples/modus-manual-script/app.js delete mode 100644 examples/modus-manual-script/index.html delete mode 100644 examples/overlay-warnings/README.md delete mode 100644 examples/overlay-warnings/app.js delete mode 100644 examples/overlay-warnings/caseSensitive.js delete mode 100644 examples/overlay-warnings/index.html delete mode 100644 examples/overlay-warnings/webpack.config.js delete mode 100644 examples/overlay/README.md delete mode 100644 examples/overlay/index.html delete mode 100644 examples/overlay/webpack.config.js delete mode 100644 examples/progress/README.md delete mode 100644 examples/progress/app.js delete mode 100644 examples/progress/index.html delete mode 100644 examples/promise-config/README.md delete mode 100644 examples/proxy-advanced/README.md delete mode 100644 examples/proxy-advanced/index.html delete mode 100644 examples/proxy-hot-reload/index.html delete mode 100644 examples/proxy-simple/index.html delete mode 100644 examples/watch-content-base/README.md delete mode 100644 examples/watch-content-base/app.js delete mode 100644 examples/webpack-config-array/index.html delete mode 100644 examples/webworker/index.html diff --git a/examples/assets/favicon.ico b/examples/.assets/favicon.ico similarity index 100% rename from examples/assets/favicon.ico rename to examples/.assets/favicon.ico diff --git a/examples/assets/geomanist-medium.woff b/examples/.assets/geomanist-medium.woff similarity index 100% rename from examples/assets/geomanist-medium.woff rename to examples/.assets/geomanist-medium.woff diff --git a/examples/assets/geomanist-medium.woff2 b/examples/.assets/geomanist-medium.woff2 similarity index 100% rename from examples/assets/geomanist-medium.woff2 rename to examples/.assets/geomanist-medium.woff2 diff --git a/examples/assets/icon-square.svg b/examples/.assets/icon-square.svg similarity index 100% rename from examples/assets/icon-square.svg rename to examples/.assets/icon-square.svg diff --git a/examples/assets/layout.html b/examples/.assets/layout.html similarity index 77% rename from examples/assets/layout.html rename to examples/.assets/layout.html index 006874d26a..b7055daf0b 100644 --- a/examples/assets/layout.html +++ b/examples/.assets/layout.html @@ -4,15 +4,15 @@ WDS ▻ <%= htmlWebpackPlugin.options.title %> - + - +

- + webpack-dev-server

diff --git a/examples/assets/style.css b/examples/.assets/style.css similarity index 100% rename from examples/assets/style.css rename to examples/.assets/style.css diff --git a/examples/cli/default/README.md b/examples/cli/default/README.md new file mode 100644 index 0000000000..4c43123877 --- /dev/null +++ b/examples/cli/default/README.md @@ -0,0 +1,25 @@ +# CLI: Default State + +This example demonstrates how to use `webpack-dev-server` in its default, inline +state. + +```console +npm run webpack-dev-server -- --open +``` + +To run your app using an alternative config, use: + +```console +npm run webpack-dev-server -- --open --config alternative.config.js +``` + +## What Should Happen + +1. The script should open `http://localhost:8080/` in your default browser. +2. You should see the text on the page itself change to read `Success!`. +3. In `app.js` uncomment the code that results in an error and save. +4. This error should be visible in the console/terminal and in the browser's devtools. +5. In `app.js` uncomment the code that results in a warning. This warning should +be visible in the console/terminal and in the browser's devtools. +6. Try changing something in `style.less`. The browser should refresh, and the +change should be visible in the app. diff --git a/examples/webpack-config-array/app.js b/examples/cli/default/app.js similarity index 70% rename from examples/webpack-config-array/app.js rename to examples/cli/default/app.js index 30895930f6..75a70584d5 100644 --- a/examples/webpack-config-array/app.js +++ b/examples/cli/default/app.js @@ -7,6 +7,12 @@ const target = document.querySelector('#target'); target.classList.add('pass'); target.innerHTML = 'Success!'; +const img = document.createElement('img'); +img.src = '/svg.svg'; +img.style = 'width: 200px;'; + +document.body.appendChild(img); + // This results in a warning: // if(!window) require("./" + window + "parseable.js"); diff --git a/examples/modus-inline/pixels.png b/examples/cli/default/pixels.png similarity index 100% rename from examples/modus-inline/pixels.png rename to examples/cli/default/pixels.png diff --git a/examples/modus-inline/style.less b/examples/cli/default/style.less similarity index 100% rename from examples/modus-inline/style.less rename to examples/cli/default/style.less diff --git a/examples/modus-inline/svg.svg b/examples/cli/default/svg.svg similarity index 100% rename from examples/modus-inline/svg.svg rename to examples/cli/default/svg.svg diff --git a/examples/modus-inline/webpack.config.js b/examples/cli/default/webpack.config.js similarity index 100% rename from examples/modus-inline/webpack.config.js rename to examples/cli/default/webpack.config.js diff --git a/examples/https/README.md b/examples/cli/https/README.md similarity index 98% rename from examples/https/README.md rename to examples/cli/https/README.md index c05ba4010d..e1fd6e4e32 100644 --- a/examples/https/README.md +++ b/examples/cli/https/README.md @@ -1,4 +1,4 @@ -# https +# CLI: Https Option By default webpack-dev-server will generate a self-signed, 2048 bit, sha256 SSL Certificate, which is used to enable https. The certificate will be located in the diff --git a/examples/https/app.js b/examples/cli/https/app.js similarity index 100% rename from examples/https/app.js rename to examples/cli/https/app.js diff --git a/examples/https/test_cert.pfx b/examples/cli/https/test_cert.pfx similarity index 100% rename from examples/https/test_cert.pfx rename to examples/cli/https/test_cert.pfx diff --git a/examples/https/webpack.config.js b/examples/cli/https/webpack.config.js similarity index 100% rename from examples/https/webpack.config.js rename to examples/cli/https/webpack.config.js diff --git a/examples/cli/iframe/README.md b/examples/cli/iframe/README.md new file mode 100644 index 0000000000..3b7057ba97 --- /dev/null +++ b/examples/cli/iframe/README.md @@ -0,0 +1,19 @@ +# CLI: Inline Iframe + +The `--no-inline` option instructs `webpack-dev-server` to open the app in an +iframe. The page then contains the client script to connect to the server. + +```shell +npm run webpack-dev-server -- --no-inline --open +``` + +## What Should Happen + +1. The script should open `http://localhost:8080/webpack-dev-server/` in your +default browser. +2. There should be a bar at the top of the page that reads `App ready`. +3. In `app.js`, uncomment the code that results in an error and save. +4. The bar at the top should read `Errors while compiling. App updated with errors. +No reload!` along with a stack trace. +5. In `app.js`, uncomment the code that results in a warning. The bar at the top +should read `Warnings while compiling`. diff --git a/examples/modus-iframe/app.js b/examples/cli/iframe/app.js similarity index 100% rename from examples/modus-iframe/app.js rename to examples/cli/iframe/app.js diff --git a/examples/listen-socket/webpack.config.js b/examples/cli/iframe/webpack.config.js similarity index 100% rename from examples/listen-socket/webpack.config.js rename to examples/cli/iframe/webpack.config.js diff --git a/examples/listen-socket/README.md b/examples/cli/listen-socket/README.md similarity index 64% rename from examples/listen-socket/README.md rename to examples/cli/listen-socket/README.md index 379a46f713..ab11649347 100644 --- a/examples/listen-socket/README.md +++ b/examples/cli/listen-socket/README.md @@ -1,25 +1,31 @@ -# Listen to socket +# CLI: Socket Option -Start dev server in socket mode: +To run the entire example, start the server with the following command: -```shell +```console npm run webpack-dev-server -- --socket ./webpack.sock ``` And then start node server that will use that socket: -```shell +```console node check-socket.js ``` +## What Should Happen + You should see this responses to this command: -```shell +```console Successfully connected to socket, exiting ``` -Common use-case for this feature is configuring upstream in nginx that points to webpack socket. -Listening to socket instead of port is much more convenient because if you have many applications you don't have to resolve port conflicts since each of them has own unique socket. +## Use Cases + +A common use-case for this feature is configuring upstream in nginx that points +to webpack socket. Listening to socket instead of port is much more convenient +because if you have many applications you don't have to resolve port conflicts +since each of them has own unique socket. Example of configuring upstream with Websockets support in nginx: @@ -40,4 +46,5 @@ location /sockjs-node/ { } ``` -Replace `/webpack/` with your `publicPath` param value and path in `proxy_pass` to your actual proxy location. +Replace `/webpack/` with your `publicPath` param value and path in `proxy_pass` +to your actual proxy location. diff --git a/examples/listen-socket/app.js b/examples/cli/listen-socket/app.js similarity index 100% rename from examples/listen-socket/app.js rename to examples/cli/listen-socket/app.js diff --git a/examples/listen-socket/check-socket.js b/examples/cli/listen-socket/check-socket.js similarity index 100% rename from examples/listen-socket/check-socket.js rename to examples/cli/listen-socket/check-socket.js diff --git a/examples/modus-iframe/webpack.config.js b/examples/cli/listen-socket/webpack.config.js similarity index 100% rename from examples/modus-iframe/webpack.config.js rename to examples/cli/listen-socket/webpack.config.js diff --git a/examples/cli/overlay/README.md b/examples/cli/overlay/README.md new file mode 100644 index 0000000000..a324352193 --- /dev/null +++ b/examples/cli/overlay/README.md @@ -0,0 +1,18 @@ +# CLI: Overlay Option + +`webpack-dev-server` can display an overlay for warnings and errors. + +```shell +npm run webpack-dev-server -- --open --overlay +``` + +_Note: To view additional options for the overlay visit +[https://webpack.js.org/configuration/dev-server/#devserver-overlay](https://webpack.js.org/configuration/dev-server/#devserver-overlay)._ + +## What Should Happen + +1. The script should open `http://localhost:8080/` in your default browser. +2. You should see the text on the page itself change to read `Success!`. +3. In `app.js` write code containing a syntax error and save the file. +4. The page should now refresh and show a full screen error overlay, displaying +the syntax error. diff --git a/examples/overlay/app.js b/examples/cli/overlay/app.js similarity index 100% rename from examples/overlay/app.js rename to examples/cli/overlay/app.js diff --git a/examples/modus-manual-script/webpack.config.js b/examples/cli/overlay/webpack.config.js similarity index 100% rename from examples/modus-manual-script/webpack.config.js rename to examples/cli/overlay/webpack.config.js diff --git a/examples/cli/progress/README.md b/examples/cli/progress/README.md new file mode 100644 index 0000000000..402acc3bca --- /dev/null +++ b/examples/cli/progress/README.md @@ -0,0 +1,12 @@ +# CLI: Progress Option + +```shell +npm run webpack-dev-server -- --open +``` + +## What Should Happen + +1. The script should open `http://localhost:8080/` in your default browser. +2. You should see the text on the page itself change to read `Success!`. +3. In `app.js` change the text and save. +4. You should see the compilation progress in the browser console. diff --git a/examples/proxy-advanced/app.js b/examples/cli/progress/app.js similarity index 100% rename from examples/proxy-advanced/app.js rename to examples/cli/progress/app.js diff --git a/examples/progress/webpack.config.js b/examples/cli/progress/webpack.config.js similarity index 100% rename from examples/progress/webpack.config.js rename to examples/cli/progress/webpack.config.js diff --git a/examples/cli/watch-content-base/README.md b/examples/cli/watch-content-base/README.md new file mode 100644 index 0000000000..02b26d94d0 --- /dev/null +++ b/examples/cli/watch-content-base/README.md @@ -0,0 +1,42 @@ +# CLI: Watch Content Base + +## Watching a single directory + +```console +npm run webpack-dev-server -- --content-base assets --watch-content-base --open +``` + +### What Should Happen + +1. The script should open `http://localhost:8080/` in your default browser. +2. You should see the text on the page itself change to read `Success!`. +3. In your editor, edit `assets/index.html` and save your changes. +4. The app should reload in the browser. + +## Watching an Array of Directories + +```js +// webpack.conf.js +module.exports = { + /* ... */ + devServer: { + contentBase: [ + "assets", + "css", + ] + } +} +``` + +```console +npm run webpack-dev-server -- --watch-content-base --open +``` + +### What Should Happen + +1. The script should open `http://localhost:8080/` in your default browser. +2. You should see the text on the page itself change to read `Success!`. +3. In your editor, edit `assets/index.html` and save your changes. +4. The app should reload. +5. In your editor, edit `css/styles.css` and save your changes. +6. The app should reload. diff --git a/examples/proxy-hot-reload/app.js b/examples/cli/watch-content-base/app.js similarity index 100% rename from examples/proxy-hot-reload/app.js rename to examples/cli/watch-content-base/app.js diff --git a/examples/watch-content-base/assets/index.html b/examples/cli/watch-content-base/assets/index.html similarity index 100% rename from examples/watch-content-base/assets/index.html rename to examples/cli/watch-content-base/assets/index.html diff --git a/examples/watch-content-base/css/styles.css b/examples/cli/watch-content-base/css/styles.css similarity index 100% rename from examples/watch-content-base/css/styles.css rename to examples/cli/watch-content-base/css/styles.css diff --git a/examples/watch-content-base/webpack.config.js b/examples/cli/watch-content-base/webpack.config.js similarity index 100% rename from examples/watch-content-base/webpack.config.js rename to examples/cli/watch-content-base/webpack.config.js diff --git a/examples/webpack-config-array/README.md b/examples/general/config-array/README.md similarity index 67% rename from examples/webpack-config-array/README.md rename to examples/general/config-array/README.md index dc532e6a77..37f95c53c8 100644 --- a/examples/webpack-config-array/README.md +++ b/examples/general/config-array/README.md @@ -1,12 +1,12 @@ -# Webpack config array +# General: Webpack Config Array -```shell +This example demonstrates using a `webpack` config containing an array of configs. + +```console npm run webpack-dev-server -- --open ``` -This opens the app with two webpack configs. - -## What should happen +## What Should Happen 1. The script should open `http://localhost:8080/` in your default browser. 2. You should see the text on the page itself change to read `Success!`. diff --git a/examples/modus-inline/app.js b/examples/general/config-array/app.js similarity index 100% rename from examples/modus-inline/app.js rename to examples/general/config-array/app.js diff --git a/examples/webpack-config-array/pixels.png b/examples/general/config-array/pixels.png similarity index 100% rename from examples/webpack-config-array/pixels.png rename to examples/general/config-array/pixels.png diff --git a/examples/webpack-config-array/style.less b/examples/general/config-array/style.less similarity index 100% rename from examples/webpack-config-array/style.less rename to examples/general/config-array/style.less diff --git a/examples/webpack-config-array/svg.svg b/examples/general/config-array/svg.svg similarity index 100% rename from examples/webpack-config-array/svg.svg rename to examples/general/config-array/svg.svg diff --git a/examples/webpack-config-array/webpack.config.js b/examples/general/config-array/webpack.config.js similarity index 100% rename from examples/webpack-config-array/webpack.config.js rename to examples/general/config-array/webpack.config.js diff --git a/examples/general/config-promise/README.md b/examples/general/config-promise/README.md new file mode 100644 index 0000000000..8e716e3821 --- /dev/null +++ b/examples/general/config-promise/README.md @@ -0,0 +1,13 @@ +# General: Promise-Based Webpack Config + +This example demonstrates using `webpack-dev-server` with a `webpack` config that +returns a `Promise`. + +```console +npm run webpack-dev-server -- --open +``` + +## What Should Happen + +1. The script should open `http://localhost:8080/` in your default browser. +2. You should see the text on the page itself change to read `Success!`. diff --git a/examples/promise-config/app.js b/examples/general/config-promise/app.js similarity index 100% rename from examples/promise-config/app.js rename to examples/general/config-promise/app.js diff --git a/examples/promise-config/index.html b/examples/general/config-promise/index.html similarity index 100% rename from examples/promise-config/index.html rename to examples/general/config-promise/index.html diff --git a/examples/promise-config/webpack.config.js b/examples/general/config-promise/webpack.config.js similarity index 100% rename from examples/promise-config/webpack.config.js rename to examples/general/config-promise/webpack.config.js diff --git a/examples/general/proxy-advanced/README.md b/examples/general/proxy-advanced/README.md new file mode 100644 index 0000000000..d4c43db420 --- /dev/null +++ b/examples/general/proxy-advanced/README.md @@ -0,0 +1,19 @@ +# General: Proxy Advanced + +This example demonstrates a user case whereby the app proxies all urls that start with `/api` to +`http://jsonplaceholder.typicode.com/`, but removes `/api` from the url. So +`http://localhost:8080/api/users` should perform a request to +`http://jsonplaceholder.typicode.com/users`. + +```console +npm run webpack-dev-server -- --open +``` + +## What should happen + +1. The script should open `http://localhost:8080/` in your default browser. +2. You should see the text on the page itself change to read `Success!`. +3. Navigate to `http://localhost:8080/api/users`. +4. The page should display several JSON objects. +5. Navigate to `http://localhost:8080/api/nope`. +6. The page should display `Bypassed proxy!``. diff --git a/examples/proxy-simple/app.js b/examples/general/proxy-advanced/app.js similarity index 100% rename from examples/proxy-simple/app.js rename to examples/general/proxy-advanced/app.js diff --git a/examples/proxy-advanced/bypass.html b/examples/general/proxy-advanced/bypass.html similarity index 100% rename from examples/proxy-advanced/bypass.html rename to examples/general/proxy-advanced/bypass.html diff --git a/examples/proxy-advanced/webpack.config.js b/examples/general/proxy-advanced/webpack.config.js similarity index 100% rename from examples/proxy-advanced/webpack.config.js rename to examples/general/proxy-advanced/webpack.config.js diff --git a/examples/proxy-hot-reload/README.md b/examples/general/proxy-hot-reload/README.md similarity index 66% rename from examples/proxy-hot-reload/README.md rename to examples/general/proxy-hot-reload/README.md index 486dddf596..bde2225169 100644 --- a/examples/proxy-hot-reload/README.md +++ b/examples/general/proxy-hot-reload/README.md @@ -1,4 +1,4 @@ -# Proxy: hot reload +# General: Proxy Hot Reload ```shell npm run webpack-dev-server -- --open @@ -11,11 +11,11 @@ object, dev server calls it on each request to get proxy config and replaces pro 1. The script should open `http://localhost:8080/` in your default browser. 2. You should see the text on the page itself change to read `Success!`. +3. Navigate to `http://localhost:8080/api/users`. +4. The page should display several JSON objects. +While the server is running, open `proxy-config.js` and replace the following: -Go to `http://localhost:8080/api/users`. It should show a couple of JSON objects. - -While dev server is running, open `proxy-config.js` and replace ```js module.exports = { target: 'http://jsonplaceholder.typicode.com/', @@ -24,11 +24,13 @@ module.exports = { } }; ``` -with + +with: + ```js module.exports = { target: 'http://reqres.in/' }; ``` -Now `http://localhost:8080/api/users` should return a response from `http://reqres.in/`. +A request to `http://localhost:8080/api/users` should return a response from `http://reqres.in/`. diff --git a/examples/general/proxy-hot-reload/app.js b/examples/general/proxy-hot-reload/app.js new file mode 100644 index 0000000000..ae384858b9 --- /dev/null +++ b/examples/general/proxy-hot-reload/app.js @@ -0,0 +1,6 @@ +'use strict'; + +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; diff --git a/examples/proxy-hot-reload/proxy-config.js b/examples/general/proxy-hot-reload/proxy-config.js similarity index 100% rename from examples/proxy-hot-reload/proxy-config.js rename to examples/general/proxy-hot-reload/proxy-config.js diff --git a/examples/proxy-hot-reload/webpack.config.js b/examples/general/proxy-hot-reload/webpack.config.js similarity index 100% rename from examples/proxy-hot-reload/webpack.config.js rename to examples/general/proxy-hot-reload/webpack.config.js diff --git a/examples/proxy-simple/README.md b/examples/general/proxy-simple/README.md similarity index 57% rename from examples/proxy-simple/README.md rename to examples/general/proxy-simple/README.md index 7e94efb46f..96e4bacacd 100644 --- a/examples/proxy-simple/README.md +++ b/examples/general/proxy-simple/README.md @@ -1,15 +1,16 @@ -# Proxy: simple +# General: Simple Proxy -```shell +```console npm run webpack-dev-server -- --open ``` In `webpack.config.js` there is a very simple configuration for a proxy. Note that this only works when proxying to a direct ip address. See the proxy-advanced example if you want to proxy to a domain. -## What should happen +## What Should Happen 1. The script should open `http://localhost:8080/` in your default browser. 2. You should see the text on the page itself change to read `Success!`. - - -Browse to `http://localhost:8080/api/hey`. Since the proxy target does not actually exist, the CLI should give the error `[HPM] PROXY ERROR: ECONNREFUSED. localhost -> http://127.0.0.1:50545/api/hey`. +3. Navigate to `http://localhost:8080/api/hey`. +4. Since the proxy target does not actually exist, the console/terminal should +display an error that reads +`[HPM] PROXY ERROR: ECONNREFUSED. localhost -> http://127.0.0.1:50545/api/hey`. diff --git a/examples/general/proxy-simple/app.js b/examples/general/proxy-simple/app.js new file mode 100644 index 0000000000..ae384858b9 --- /dev/null +++ b/examples/general/proxy-simple/app.js @@ -0,0 +1,6 @@ +'use strict'; + +const target = document.querySelector('#target'); + +target.classList.add('pass'); +target.innerHTML = 'Success!'; diff --git a/examples/proxy-simple/webpack.config.js b/examples/general/proxy-simple/webpack.config.js similarity index 100% rename from examples/proxy-simple/webpack.config.js rename to examples/general/proxy-simple/webpack.config.js diff --git a/examples/webworker/README.md b/examples/general/webworker/README.md similarity index 73% rename from examples/webworker/README.md rename to examples/general/webworker/README.md index d765e25036..a57e958cfc 100644 --- a/examples/webworker/README.md +++ b/examples/general/webworker/README.md @@ -1,13 +1,11 @@ -# Webworker +# General: WebWorker +This example demonstrates using a WebWorker within an app run by `webpack-dev-server`. -## How to run - -```shell +```console npm run webpack-dev-server ``` - ## What should happen 1. The main thread sends a message to the Worker. diff --git a/examples/webworker/web.js b/examples/general/webworker/web.js similarity index 100% rename from examples/webworker/web.js rename to examples/general/webworker/web.js diff --git a/examples/webworker/webpack.config.js b/examples/general/webworker/webpack.config.js similarity index 80% rename from examples/webworker/webpack.config.js rename to examples/general/webworker/webpack.config.js index ffe6f9cc21..9e4392bdd3 100644 --- a/examples/webworker/webpack.config.js +++ b/examples/general/webworker/webpack.config.js @@ -8,11 +8,7 @@ module.exports = [ setup({ devtool: 'source-map', target: 'web', - entry: './web.js', - output: { - filename: 'web.bundle.js', - path: __dirname - } + entry: './web.js' }), { devtool: 'source-map', diff --git a/examples/webworker/worker.js b/examples/general/webworker/worker.js similarity index 100% rename from examples/webworker/worker.js rename to examples/general/webworker/worker.js diff --git a/examples/https/index.html b/examples/https/index.html deleted file mode 100644 index 8d5ac571e2..0000000000 --- a/examples/https/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -

Example: https

- - diff --git a/examples/modus-iframe/README.md b/examples/modus-iframe/README.md deleted file mode 100644 index 9e53eb161f..0000000000 --- a/examples/modus-iframe/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Modus: iframe - -```shell -npm run webpack-dev-server -- --no-inline --open -``` - -The app is started in an iframe. The page contains the client script to connect to webpack-dev-server. - -## What should happen - -It should open `http://localhost:8080/webpack-dev-server/`. In the bar at the top, the text should say `App ready.` - -In `app.js`, uncomment the code that results in an error and save. The bar at the top should display `Errors while compiling. App updated with errors. No reload!` with a stack trace underneath it. - -Then, in `app.js`, uncomment the code that results in a warning. The bar at the top should display `Warnings while compiling.`. diff --git a/examples/modus-iframe/index.html b/examples/modus-iframe/index.html deleted file mode 100644 index ab73c5d4de..0000000000 --- a/examples/modus-iframe/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -

Example: modus - iframe

- - diff --git a/examples/modus-inline/README.md b/examples/modus-inline/README.md deleted file mode 100644 index c2b4206cf4..0000000000 --- a/examples/modus-inline/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Modus: inline - -```shell -npm run webpack-dev-server -- --open -``` - -This opens the app in `inline` modus (which is the default). - -```shell -npm run webpack-dev-server -- --open --config alternative.config.js -``` - -This also opens the app in `inline` modus, but with a custom config. - -## What should happen - -1. The script should open `http://localhost:8080/` in your default browser. -2. You should see the text on the page itself change to read `Success!`. - -In `app.js`, uncomment the code that results in an error and save. This error should be visible in the CLI and devtools. - -Then, in `app.js`, uncomment the code that results in a warning. This warning should be visible in the CLI and devtools. - -Also try to change something in `style.less`. The browser should refresh, and the change should be visible in the app. diff --git a/examples/modus-inline/index.html b/examples/modus-inline/index.html deleted file mode 100644 index 0a1a90d18c..0000000000 --- a/examples/modus-inline/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - -

Example: modus - inline

-
- - - diff --git a/examples/modus-manual-script/README.md b/examples/modus-manual-script/README.md deleted file mode 100644 index aa878f95ec..0000000000 --- a/examples/modus-manual-script/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Modus: manual script - -```shell -npm run webpack-dev-server -- --open --no-inline -``` - -The webpack-dev-server client is added as script tag to the html page. - -```shell -npm run webpack-dev-server -- --open --no-inline --https -``` - -This will do the same, but connect over https. - -## What should happen - -Try to update app.js by uncommenting some lines. The browser should reflect your changes. - -If there is a compilation error or warning, this should be displayed in the CLI and devtools. - -For the `--https` variant, it should do the same. Make sure to test this when making changes to how the websocket URL is parsed. diff --git a/examples/modus-manual-script/app.js b/examples/modus-manual-script/app.js deleted file mode 100644 index bc127811c7..0000000000 --- a/examples/modus-manual-script/app.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -const target = document.querySelector('#target'); - -target.classList.add('pass'); -target.innerHTML = 'Success!'; - -// This results in a warning: -// if(!window) require("./" + window + "parseable.js"); - -// This results in an error: -// if(!window) require("test"); diff --git a/examples/modus-manual-script/index.html b/examples/modus-manual-script/index.html deleted file mode 100644 index c314f00fbf..0000000000 --- a/examples/modus-manual-script/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - -

Example: modus - manual script

- - diff --git a/examples/overlay-warnings/README.md b/examples/overlay-warnings/README.md deleted file mode 100644 index 019463b4ea..0000000000 --- a/examples/overlay-warnings/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Overlay - -```shell -npm run webpack-dev-server -- --open -``` - -## What should happen - -The script should open the browser and show a heading with "Example: overlay with warnings". - -In `app.js`, uncomment the lines that should cause a warning to appear. The page should now refresh and show a full screen overlay that shows the warning. diff --git a/examples/overlay-warnings/app.js b/examples/overlay-warnings/app.js deleted file mode 100644 index c1c6a4931a..0000000000 --- a/examples/overlay-warnings/app.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -const target = document.querySelector('#target'); - -target.classList.add('pass'); -target.innerHTML = 'Success!'; - -// This results in a warning: -// require("./casesensitive.js"); -// require("./caseSensitive.js"); - -// This results in an error: -// if(!window) require("test"); diff --git a/examples/overlay-warnings/caseSensitive.js b/examples/overlay-warnings/caseSensitive.js deleted file mode 100644 index d5329d30bd..0000000000 --- a/examples/overlay-warnings/caseSensitive.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -console.log('case sensitive'); diff --git a/examples/overlay-warnings/index.html b/examples/overlay-warnings/index.html deleted file mode 100644 index b3c1b3e94d..0000000000 --- a/examples/overlay-warnings/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -

Example: overlay with warnings

- - diff --git a/examples/overlay-warnings/webpack.config.js b/examples/overlay-warnings/webpack.config.js deleted file mode 100644 index a84f2ac9e7..0000000000 --- a/examples/overlay-warnings/webpack.config.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -// our setup function adds behind-the-scenes bits to the config that all of our -// examples need -const { setup } = require('../../util'); - -module.exports = setup({ - context: __dirname, - entry: './app.js', - devServer: { - overlay: { - errors: true, - warnings: true - } - } -}); diff --git a/examples/overlay/README.md b/examples/overlay/README.md deleted file mode 100644 index 1886f59662..0000000000 --- a/examples/overlay/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Overlay - -```shell -npm run webpack-dev-server -- --open -``` - -## What should happen - -The script should open the browser and show a heading with "Example: overlay". - -In `app.js`, make a syntax error. The page should now refresh and show a full screen error overlay that shows the syntax error. diff --git a/examples/overlay/index.html b/examples/overlay/index.html deleted file mode 100644 index 5a3999971c..0000000000 --- a/examples/overlay/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -

Example: overlay

- - diff --git a/examples/overlay/webpack.config.js b/examples/overlay/webpack.config.js deleted file mode 100644 index a2dc62f1e8..0000000000 --- a/examples/overlay/webpack.config.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -// our setup function adds behind-the-scenes bits to the config that all of our -// examples need -const { setup } = require('../../util'); - -module.exports = setup({ - context: __dirname, - entry: './app.js', - devServer: { - overlay: true - } -}); diff --git a/examples/progress/README.md b/examples/progress/README.md deleted file mode 100644 index 57556674d5..0000000000 --- a/examples/progress/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Status - -```shell -npm run webpack-dev-server -- --open -``` - -## What should happen - -The script should open the browser and show a heading with "Example: progress". - -In `app.js`, change the text and save. You should see the compilation progress in the browser console. diff --git a/examples/progress/app.js b/examples/progress/app.js deleted file mode 100644 index 05573ed58d..0000000000 --- a/examples/progress/app.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -// Change the following line and save to see the compilation status - -document.write('Change me to see compilation progress in console...'); diff --git a/examples/progress/index.html b/examples/progress/index.html deleted file mode 100644 index 3a1765cd01..0000000000 --- a/examples/progress/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Progress example - - - -

Example: progress

- - diff --git a/examples/promise-config/README.md b/examples/promise-config/README.md deleted file mode 100644 index cd26b3b258..0000000000 --- a/examples/promise-config/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Promise-Based Config - -```shell -npm run webpack-dev-server -- --open -``` - -## What should happen - -The script should open the browser and show a heading with "Example: Promise Config". diff --git a/examples/proxy-advanced/README.md b/examples/proxy-advanced/README.md deleted file mode 100644 index 676f5dc5ed..0000000000 --- a/examples/proxy-advanced/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# Proxy: advanced - -```shell -npm run webpack-dev-server -- --open -``` - -We want to proxy all urls that start with `/api` to `http://jsonplaceholder.typicode.com/`, but remove `/api` from the url. So `http://localhost:8080/api/users` should do a request to `http://jsonplaceholder.typicode.com/users`. - -## What should happen - -1. The script should open `http://localhost:8080/` in your default browser. -2. You should see the text on the page itself change to read `Success!`. - - -Go to `http://localhost:8080/api/users`. It should show a couple of JSON objects. - -Go to `http://localhost:8080/api/nope`. It should show the "Bypassed proxy!". diff --git a/examples/proxy-advanced/index.html b/examples/proxy-advanced/index.html deleted file mode 100644 index b1331f6de3..0000000000 --- a/examples/proxy-advanced/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -

Example: proxy - advanced

- - diff --git a/examples/proxy-hot-reload/index.html b/examples/proxy-hot-reload/index.html deleted file mode 100644 index 8af7611a5d..0000000000 --- a/examples/proxy-hot-reload/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -

Example: proxy - hot reload

-

Change config in proxy-config.js and open /api/users

- - diff --git a/examples/proxy-simple/index.html b/examples/proxy-simple/index.html deleted file mode 100644 index 3a2131c886..0000000000 --- a/examples/proxy-simple/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -

Example: proxy - simple

- - diff --git a/examples/util.js b/examples/util.js index f003a72ad7..7fafa66b35 100644 --- a/examples/util.js +++ b/examples/util.js @@ -13,7 +13,7 @@ module.exports = { const defaults = { plugins: [], devServer: {} }; const result = Object.assign(defaults, config); const before = function before(app) { - app.get('/assets/*', (req, res) => { + app.get('/.assets/*', (req, res) => { const filename = path.join(__dirname, '/', req.path); res.sendFile(filename); }); @@ -55,7 +55,7 @@ module.exports = { result.plugins.push(new webpack.NamedModulesPlugin()); result.plugins.push(new HtmlWebpackPlugin({ filename: 'index.html', - template: path.join(__dirname, 'assets/layout.html'), + template: path.join(__dirname, '.assets/layout.html'), title: exampleTitle })); diff --git a/examples/watch-content-base/README.md b/examples/watch-content-base/README.md deleted file mode 100644 index 3cb9087a95..0000000000 --- a/examples/watch-content-base/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Watch Content Base - -## Watching a single directory - -```shell -npm run webpack-dev-server -- --content-base assets --watch-content-base --open -``` - -### What should happen - -The script should open `http://localhost:8080/`. In the app you should see "Does it work?" - -In your editor, edit `assets/index.html`, and save your changes. The app should reload. - - -## Watching an array of directories - -```javascript -// webpack.conf.js -module.exports = { - /* ... */ - devServer: { - contentBase: [ - "assets", - "css", - ] - } -} -``` - -```shell -npm run webpack-dev-server -- --watch-content-base --open -``` - -### What should happen - -The script should open `http://localhost:8080/`. In the app you should see "Does it work?" - -In your editor, edit `assets/index.html`, and save your changes. The app should reload. - -In your editor, edit `css/styles.css`, and save your changes. The app should reload. diff --git a/examples/watch-content-base/app.js b/examples/watch-content-base/app.js deleted file mode 100644 index 3ac3dcda45..0000000000 --- a/examples/watch-content-base/app.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -const myText = document.getElementById('mytext'); -myText.textContent = 'Does it work? yes'; diff --git a/examples/webpack-config-array/index.html b/examples/webpack-config-array/index.html deleted file mode 100644 index 4e18a584b9..0000000000 --- a/examples/webpack-config-array/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -

Example: webpack config array

- - diff --git a/examples/webworker/index.html b/examples/webworker/index.html deleted file mode 100644 index 1d1b9ede48..0000000000 --- a/examples/webworker/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Example "webworker" - - - - - From 28a44d922d72c13498678dd9a6274f95a783614d Mon Sep 17 00:00:00 2001 From: shellscape Date: Mon, 13 Nov 2017 21:35:21 -0500 Subject: [PATCH 7/7] fix up the cli tests since the examples path changed --- examples/general/proxy-hot-reload/webpack.config.js | 8 +++----- test/cli.test.js | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/general/proxy-hot-reload/webpack.config.js b/examples/general/proxy-hot-reload/webpack.config.js index 6a3b60f9bd..db7f6b14da 100644 --- a/examples/general/proxy-hot-reload/webpack.config.js +++ b/examples/general/proxy-hot-reload/webpack.config.js @@ -1,8 +1,10 @@ 'use strict'; /* eslint global-require: off */ - const fs = require('fs'); +// our setup function adds behind-the-scenes bits to the config that all of our +// examples need +const { setup } = require('../../util'); const proxyConfig = require('./proxy-config'); let proxyOptions = { @@ -30,10 +32,6 @@ fs.watch('./proxy-config.js', () => { } }); -// our setup function adds behind-the-scenes bits to the config that all of our -// examples need -const { setup } = require('../../util'); - module.exports = setup({ context: __dirname, entry: './app.js', diff --git a/test/cli.test.js b/test/cli.test.js index 159b330a68..20bcb02225 100644 --- a/test/cli.test.js +++ b/test/cli.test.js @@ -7,7 +7,7 @@ const execa = require('execa'); describe('SIGINT', () => { it('should exit the process when SIGINT is detected', (done) => { const cliPath = path.resolve(__dirname, '../bin/webpack-dev-server.js'); - const examplePath = path.resolve(__dirname, '../examples/cli-public'); + const examplePath = path.resolve(__dirname, '../examples/cli/public'); const nodePath = execa.shellSync('which node').stdout; const proc = execa(nodePath, [cliPath], { cwd: examplePath });