overleaf/services/web/webpack.config.dev.js
Alf Eaton a5637651b5 Add Content-Security-Policy header (#3783)
* Add Content-Security-Policy header
* Add nonce attribute to script tags
* Use source-map for webpack devtool
* Add ng-csp attribute when CSP is enabled
* Allow overriding CSP settings with environment variables
* Hook into render and allow routes to disable the CSP header

GitOrigin-RevId: a873736a3514198165f1b2f1e18d002b65f20d30
2021-03-26 03:04:55 +00:00

39 lines
1 KiB
JavaScript

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'
})
],
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/]
}
}
})