1 parent
c3ce909434
commit
33307d3cd2
18 files changed
+1377
-245
No files matched your search
@@ -26,6 +26,16 @@ const PROXY_TARGET = process.env.PROXY_TARGET;
|
||||
const PROXY_DOMAIN = process.env.PROXY_DOMAIN;
|
||||
const ENTRY_TARGET = process.env.ENTRY_TARGET || `${SRC_DIR}/index.js`;
|
||||
|
||||
|
||||
const setHeaders = (res, path) => {
|
||||
res.setHeader('Content-Type', 'text/plain')
|
||||
if (path.indexOf('.gz') !== -1) {
|
||||
res.setHeader('Content-Encoding', 'gzip')
|
||||
} else if (path.indexOf('.br') !== -1) {
|
||||
res.setHeader('Content-Encoding', 'br')
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
const baseConfig = webpackBase(env, argv, { SRC_DIR, DIST_DIR });
|
||||
const isProdBuild = process.env.NODE_ENV === 'production';
|
||||
@@ -134,11 +144,40 @@ module.exports = (env, argv) => {
|
||||
hot: true,
|
||||
open: true,
|
||||
port: 3000,
|
||||
host: '0.0.0.0',
|
||||
public: 'http://localhost:' + 3000,
|
||||
client: {
|
||||
overlay: { errors: true, warnings: false },
|
||||
},
|
||||
'static': [
|
||||
{
|
||||
directory: path.join(require('os').homedir(), 'dicomweb'),
|
||||
staticOptions: {
|
||||
extensions: ['gz', 'br'],
|
||||
index: "index.json.gz",
|
||||
redirect: true,
|
||||
setHeaders,
|
||||
},
|
||||
publicPath: '/dicomweb',
|
||||
},
|
||||
{
|
||||
directory: '../../testdata',
|
||||
staticOptions: {
|
||||
extensions: ['gz', 'br'],
|
||||
index: "index.json.gz",
|
||||
redirect: true,
|
||||
setHeaders,
|
||||
},
|
||||
publicPath: '/testdata',
|
||||
},
|
||||
],
|
||||
//public: 'http://localhost:' + 3000,
|
||||
//writeToDisk: true,
|
||||
historyApiFallback: {
|
||||
disableDotRule: true,
|
||||
},
|
||||
headers: {
|
||||
'Cross-Origin-Embedder-Policy': 'require-corp',
|
||||
'Cross-Origin-Opener-Policy': 'same-origin',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user