mirror of
https://github.com/mastodon/mastodon.git
synced 2025-05-07 12:16:14 +00:00
40 lines
910 B
JavaScript
40 lines
910 B
JavaScript
const { env, merge } = require('shakapacker');
|
|
const markRule = require('../rules/mark');
|
|
const baseConfig = require('./base');
|
|
|
|
/** @type {import('webpack').Configuration} */
|
|
let developmentConfig = {
|
|
module: {
|
|
rules: [
|
|
markRule,
|
|
],
|
|
},
|
|
};
|
|
|
|
if (env.runningWebpackDevServer) {
|
|
developmentConfig = merge(developmentConfig, {
|
|
devServer: {
|
|
devMiddleware: {
|
|
writeToDisk: filePath => /ocr/.test(filePath),
|
|
},
|
|
},
|
|
});
|
|
}
|
|
|
|
if (process.env.VAGRANT) {
|
|
developmentConfig = merge(developmentConfig, {
|
|
devServer: {
|
|
static: {
|
|
watch: {
|
|
// 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.
|
|
poll: 1_000,
|
|
},
|
|
},
|
|
},
|
|
});
|
|
}
|
|
|
|
module.exports = merge({}, baseConfig, developmentConfig);
|