Skip to content

Commit

Permalink
feat(docz-core): add webpack-serve-waitpage
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Jul 11, 2018
1 parent d39d6e9 commit 83c493b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/docz-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"webpack-hot-client": "^4.1.1",
"webpack-manifest-plugin": "^2.0.3",
"webpack-serve": "^2.0.2",
"webpack-serve-waitpage": "^1.0.0",
"webpackbar": "^2.6.1",
"ws": "^5.2.1",
"yargs": "^12.0.1"
Expand Down
5 changes: 4 additions & 1 deletion packages/docz-core/src/bundlers/webpack/devserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as path from 'path'
import { Configuration } from 'webpack'
import convert from 'koa-connect'
import history from 'connect-history-api-fallback'
import serveWaitpage from 'webpack-serve-waitpage'

import { Config } from '../../commands/args'

Expand All @@ -22,14 +23,16 @@ export const devServerConfig = (args: Config, config: Configuration) => {
reload: false,
logLevel: logLevel('error'),
},
add: (app: any) => {
add: (app: any, middleware: any, options: any) => {
app.use(
convert(
history({
rewrites: [{ from: /\.html$/, to: '/' }],
})
)
)

app.use(serveWaitpage(options, { title: args.title }))
},
}
}
1 change: 1 addition & 0 deletions packages/docz-core/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ declare module 'lodash.get'
declare module 'signale'
declare module 'webpackbar'
declare module 'webpack-serve'
declare module 'webpack-serve-waitpage'
declare module 'koa-mount'
declare module 'koa-connect'
declare module 'koa-static'
Expand Down
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4467,6 +4467,10 @@ ee-first@1.1.1:
version "1.1.1"
resolved "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"

ejs@^2.6.1:
version "2.6.1"
resolved "https://registry.npmjs.org/ejs/-/ejs-2.6.1.tgz#498ec0d495655abc6f23cd61868d926464071aa0"

electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.47:
version "1.3.49"
resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.49.tgz#651384b0d81f078a96639b2b36975141b7915004"
Expand Down Expand Up @@ -11798,6 +11802,12 @@ webpack-manifest-plugin@^2.0.3:
lodash ">=3.5 <5"
tapable "^1.0.0"

webpack-serve-waitpage@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/webpack-serve-waitpage/-/webpack-serve-waitpage-1.0.0.tgz#182ad1a4a43af4a5db384e0befcd2ed5e3f98287"
dependencies:
ejs "^2.6.1"

webpack-serve@^2.0.2:
version "2.0.2"
resolved "https://registry.npmjs.org/webpack-serve/-/webpack-serve-2.0.2.tgz#6263b7c2888e169f84105da2119079098512b404"
Expand Down

0 comments on commit 83c493b

Please sign in to comment.