UNPKG

1.57 kBJavaScriptView Raw
1'use strict'
2
3/** Development environment specfic configurations */
4module.exports = ({ devServer, paths }) => ({
5 // Default to "best quality SourceMaps for development" (Set DEVTOOL to 'eval'
6 // to see generated code,)
7 devtool: process.env.DEVTOOL || 'eval-source-map',
8
9 // Development plugins
10 // ---------------------------------------------------------------------------
11 plugins: ['hotModuleReplacementPlugin', 'friendlyErrorsPlugin'],
12
13 // webpack-dev-server
14 // ---------------------------------------------------------------------------
15
16 /**
17 * WDS docs: https://github.com/webpack/webpack-dev-server
18 * File serving debug info served at /webpack-dev-server
19 */
20 devServer: {
21 // ℹ️ clientLogLevel - Suppress logging, the FriendlyErrors plugin displays
22 // cleaner messaging Controls the console logs in the browser before
23 // reloading, HMR, etc.
24
25 // Serve static file from the public file (only required for files not
26 // imported into project)
27 contentBase: paths.static,
28 // Serve index.html for all unmatched routes
29 historyApiFallback: true,
30 // Enable hot module replacement feature
31 hot: true,
32 // Supress messages output, they're managed by the ProgressBarPlugin and the
33 // FriendlyErrors plugin
34 noInfo: true,
35 // Disable auto-open until a re-use tab solution is figured out
36 open: false,
37 // Show compilation errors and warnings
38 overlay: {
39 warnings: false,
40 errors: true,
41 },
42 // The.port.
43 port: 3000,
44 // Custom overrides
45 ...devServer,
46 },
47})