mirror of
https://github.com/nasa/openmct.git
synced 2025-06-21 08:39:59 +00:00
Couch object provider performance improvement using SharedWorker (#3993)
* Use the window SharedWorker instead of the WorkerService * Use relative asset path for Shared Workers * Remove beforeunload listener on destroy
This commit is contained in:
@ -14,19 +14,21 @@ const gitRevision = require('child_process')
|
||||
const gitBranch = require('child_process')
|
||||
.execSync('git rev-parse --abbrev-ref HEAD')
|
||||
.toString().trim();
|
||||
const vueFile = devMode ?
|
||||
path.join(__dirname, "node_modules/vue/dist/vue.js") :
|
||||
path.join(__dirname, "node_modules/vue/dist/vue.min.js");
|
||||
const vueFile = devMode
|
||||
? path.join(__dirname, "node_modules/vue/dist/vue.js")
|
||||
: path.join(__dirname, "node_modules/vue/dist/vue.min.js");
|
||||
|
||||
const webpackConfig = {
|
||||
mode: devMode ? 'development' : 'production',
|
||||
entry: {
|
||||
openmct: './openmct.js',
|
||||
couchDBChangesFeed: './src/plugins/persistence/couch/CouchChangesFeed.js',
|
||||
espressoTheme: './src/plugins/themes/espresso-theme.scss',
|
||||
snowTheme: './src/plugins/themes/snow-theme.scss',
|
||||
maelstromTheme: './src/plugins/themes/maelstrom-theme.scss'
|
||||
},
|
||||
output: {
|
||||
globalObject: "this",
|
||||
filename: '[name].js',
|
||||
library: '[name]',
|
||||
libraryTarget: 'umd',
|
||||
@ -105,13 +107,15 @@ const webpackConfig = {
|
||||
name: '[name].[ext]',
|
||||
outputPath(url, resourcePath, context) {
|
||||
if (/\.(jpg|jpeg|png|svg)$/.test(url)) {
|
||||
return `images/${url}`
|
||||
return `images/${url}`;
|
||||
}
|
||||
|
||||
if (/\.ico$/.test(url)) {
|
||||
return `icons/${url}`
|
||||
return `icons/${url}`;
|
||||
}
|
||||
|
||||
if (/\.(woff2?|eot|ttf)$/.test(url)) {
|
||||
return `fonts/${url}`
|
||||
return `fonts/${url}`;
|
||||
} else {
|
||||
return `${url}`;
|
||||
}
|
||||
|
Reference in New Issue
Block a user