mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
10e7a919c0
Re-enable React Dev Tools GitOrigin-RevId: 2757888b03997b9df55f1ef1a8fa0cca71cbcc78
48 lines
1.3 KiB
JavaScript
48 lines
1.3 KiB
JavaScript
const webpack = require('webpack')
|
|
const merge = require('webpack-merge')
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
|
|
|
const base = require('./webpack.config')
|
|
|
|
module.exports = merge(base, {
|
|
mode: 'development',
|
|
|
|
// Enable accurate source maps for dev
|
|
devtool: 'source-map',
|
|
|
|
plugins: [
|
|
// Extract CSS to a separate file (rather than inlining to a <style> tag)
|
|
new MiniCssExtractPlugin({
|
|
// Output to public/stylesheets directory
|
|
filename: 'stylesheets/[name].css',
|
|
}),
|
|
|
|
// Disable React DevTools if DISABLE_REACT_DEVTOOLS is set to "true"
|
|
new webpack.DefinePlugin({
|
|
__REACT_DEVTOOLS_GLOBAL_HOOK__:
|
|
process.env.DISABLE_REACT_DEVTOOLS === 'true'
|
|
? '({ isDisabled: true })'
|
|
: undefined,
|
|
}),
|
|
],
|
|
|
|
devServer: {
|
|
// Expose dev server at www.dev-overleaf.com
|
|
host: '0.0.0.0',
|
|
port: 3808,
|
|
public: 'www.dev-overleaf.com:443',
|
|
|
|
// Customise output to the (node) console
|
|
stats: {
|
|
colors: true, // Enable some coloured highlighting
|
|
// Hide some overly verbose output
|
|
performance: false, // Disable as code is uncompressed in dev mode
|
|
hash: false,
|
|
version: false,
|
|
chunks: false,
|
|
modules: false,
|
|
// Hide copied assets from output
|
|
excludeAssets: [/^js\/ace/, /^js\/libs/, /^js\/cmaps/],
|
|
},
|
|
},
|
|
})
|