mirror of
https://github.com/jpd002/Play-.git
synced 2025-04-28 21:57:57 +03:00
28 lines
1 KiB
JavaScript
28 lines
1 KiB
JavaScript
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
|
module.exports = {
|
|
// Extend/override the dev server configuration used by CRA
|
|
// See: https://github.com/timarney/react-app-rewired#extended-configuration-options
|
|
devServer: function(configFunction) {
|
|
return function(proxy, allowedHost) {
|
|
// Create the default config by calling configFunction with the proxy/allowedHost parameters
|
|
// Default config: https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/config/webpackDevServer.config.js
|
|
const config = configFunction(proxy, allowedHost);
|
|
|
|
config.headers = {
|
|
'Cross-Origin-Embedder-Policy': 'require-corp',
|
|
'Cross-Origin-Opener-Policy': 'same-origin'
|
|
}
|
|
|
|
return config;
|
|
};
|
|
},
|
|
webpack: function(config, env) {
|
|
//Disable HTML minification on all build types
|
|
const webpackPlugin = config.plugins.find((plugin) => plugin instanceof HtmlWebpackPlugin);
|
|
if(webpackPlugin) {
|
|
webpackPlugin.userOptions.minify = false;
|
|
}
|
|
return config;
|
|
}
|
|
};
|