2017-05-03 03:04:16 +03:00
|
|
|
// Note: You must restart bin/webpack-dev-server for changes to take effect
|
|
|
|
|
2020-11-04 19:21:28 +02:00
|
|
|
const { merge } = require('webpack-merge');
|
2023-05-23 18:15:17 +03:00
|
|
|
|
2019-03-15 16:05:31 +02:00
|
|
|
const { settings, output } = require('./configuration');
|
2023-05-23 18:15:17 +03:00
|
|
|
const sharedConfig = require('./shared');
|
2017-05-03 03:04:16 +03:00
|
|
|
|
2019-03-15 16:05:31 +02:00
|
|
|
const watchOptions = {};
|
2017-10-04 10:52:11 +03:00
|
|
|
|
|
|
|
if (process.env.VAGRANT) {
|
|
|
|
// If we are in Vagrant, we can't rely on inotify to update us with changed
|
|
|
|
// files, so we must poll instead. Here, we poll every second to see if
|
|
|
|
// anything has changed.
|
|
|
|
watchOptions.poll = 1000;
|
|
|
|
}
|
|
|
|
|
2017-05-03 03:04:16 +03:00
|
|
|
module.exports = merge(sharedConfig, {
|
2018-07-14 04:56:41 +03:00
|
|
|
mode: 'development',
|
2019-03-15 16:05:31 +02:00
|
|
|
cache: true,
|
2017-05-07 16:22:30 +03:00
|
|
|
devtool: 'cheap-module-eval-source-map',
|
2017-05-03 03:04:16 +03:00
|
|
|
|
|
|
|
stats: {
|
2017-05-20 18:31:47 +03:00
|
|
|
errorDetails: true,
|
2017-05-03 03:04:16 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
output: {
|
2017-05-20 18:31:47 +03:00
|
|
|
pathinfo: true,
|
|
|
|
},
|
2017-06-18 03:57:09 +03:00
|
|
|
|
|
|
|
devServer: {
|
|
|
|
clientLogLevel: 'none',
|
2019-03-15 16:05:31 +02:00
|
|
|
compress: settings.dev_server.compress,
|
|
|
|
quiet: settings.dev_server.quiet,
|
|
|
|
disableHostCheck: settings.dev_server.disable_host_check,
|
2017-06-18 03:57:09 +03:00
|
|
|
host: settings.dev_server.host,
|
|
|
|
port: settings.dev_server.port,
|
2019-03-15 16:05:31 +02:00
|
|
|
https: settings.dev_server.https,
|
|
|
|
hot: settings.dev_server.hmr,
|
2017-06-18 03:57:09 +03:00
|
|
|
contentBase: output.path,
|
2019-03-15 16:05:31 +02:00
|
|
|
inline: settings.dev_server.inline,
|
|
|
|
useLocalIp: settings.dev_server.use_local_ip,
|
|
|
|
public: settings.dev_server.public,
|
2017-06-18 03:57:09 +03:00
|
|
|
publicPath: output.publicPath,
|
2019-03-15 16:05:31 +02:00
|
|
|
historyApiFallback: {
|
|
|
|
disableDotRule: true,
|
|
|
|
},
|
|
|
|
headers: settings.dev_server.headers,
|
|
|
|
overlay: settings.dev_server.overlay,
|
|
|
|
stats: {
|
|
|
|
entrypoints: false,
|
|
|
|
errorDetails: false,
|
|
|
|
modules: false,
|
|
|
|
moduleTrace: false,
|
|
|
|
},
|
|
|
|
watchOptions: Object.assign(
|
|
|
|
{},
|
|
|
|
settings.dev_server.watch_options,
|
2020-03-08 17:02:36 +02:00
|
|
|
watchOptions,
|
2019-03-15 16:05:31 +02:00
|
|
|
),
|
2019-08-15 16:13:26 +03:00
|
|
|
writeToDisk: filePath => /ocr/.test(filePath),
|
2017-06-18 03:57:09 +03:00
|
|
|
},
|
2017-05-20 18:31:47 +03:00
|
|
|
});
|