This repository has been archived by the owner on Jan 24, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docz-core): refac webpack bundler
- Loading branch information
1 parent
aca1c1e
commit 8a92fbf
Showing
6 changed files
with
88 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
packages/playgrodd-core/src/bundlers/webpack/config-devserver.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Application } from 'express' | ||
import * as errorOverlayMiddleware from 'react-dev-utils/errorOverlayMiddleware' | ||
|
||
import * as paths from '../../config/paths' | ||
|
||
export const PROTOCOL = process.env.HTTPS === 'true' ? 'https' : 'http' | ||
export const HOST = process.env.HOST || '0.0.0.0' | ||
|
||
export const devServerConfig = () => ({ | ||
compress: true, | ||
clientLogLevel: 'none', | ||
contentBase: paths.PLAYGRODD, | ||
watchContentBase: true, | ||
hot: true, | ||
quiet: true, | ||
noInfo: true, | ||
publicPath: '/', | ||
https: PROTOCOL === 'https', | ||
host: HOST, | ||
overlay: false, | ||
watchOptions: { | ||
ignored: /node_modules/, | ||
}, | ||
stats: { | ||
colors: true, | ||
chunks: false, | ||
chunkModules: false, | ||
}, | ||
historyApiFallback: { | ||
disableDotRule: true, | ||
}, | ||
before(app: Application) { | ||
app.use(errorOverlayMiddleware()) | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Configuration } from 'webpack' | ||
import * as WebpackDevServer from 'webpack-dev-server' | ||
|
||
import { Bundler } from '../../Bundler' | ||
import { config, setup, server } from './config-dev' | ||
|
||
interface IBundlerParams { | ||
port: number | ||
} | ||
|
||
export const bundler = ({ port }: IBundlerParams): Bundler => | ||
new Bundler<Configuration, WebpackDevServer>({ | ||
id: 'webpack', | ||
config, | ||
server, | ||
setup: setup(port), | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters