Compare commits

...

4 Commits

Author SHA1 Message Date
Jesse Mazzella
96f5fe9a33 fix: update index.html for esm 2024-02-26 19:02:32 -08:00
Mazzella, Jesse D. (ARC-TI)[KBR Wyle Services, LLC]
ba4219ffba chore: update worker file extensions to .mjs 2024-02-26 18:22:08 -08:00
Mazzella, Jesse D. (ARC-TI)[KBR Wyle Services, LLC]
0dc6927b4c chore: remove default export 2024-02-26 18:21:42 -08:00
Jesse Mazzella
92db027ff9 try exporting as module 2024-02-26 17:29:41 -08:00
7 changed files with 20 additions and 12 deletions

View File

@@ -52,11 +52,11 @@ const config = {
},
output: {
globalObject: 'this',
filename: '[name].js',
filename: '[name].mjs',
path: path.resolve(projectRootDir, 'dist'),
library: 'openmct',
libraryExport: 'default',
libraryTarget: 'umd',
library: {
type: 'module'
},
publicPath: '',
hashFunction: 'xxhash64',
clean: true
@@ -179,6 +179,9 @@ const config = {
// these values
maxEntrypointSize: 27000000,
maxAssetSize: 27000000
},
experiments: {
outputModule: true
}
};

View File

@@ -3,10 +3,11 @@ This configuration should be used for development purposes. It contains full sou
devServer (which be invoked using by `npm start`), and a non-minified Vue.js distribution.
If OpenMCT is to be used for a production server, use webpack.prod.js instead.
*/
import { fileURLToPath } from 'node:url';
import path from 'path';
import webpack from 'webpack';
import { merge } from 'webpack-merge';
import { fileURLToPath } from 'node:url';
import common from './webpack.common.js';

View File

@@ -24,7 +24,7 @@ import { v4 as uuid } from 'uuid';
export default function WorkerInterface(openmct, StalenessProvider) {
// eslint-disable-next-line no-undef
const workerUrl = `${openmct.getAssetPath()}${__OPENMCT_ROOT_RELATIVE__}generatorWorker.js`;
const workerUrl = `${openmct.getAssetPath()}${__OPENMCT_ROOT_RELATIVE__}generatorWorker.mjs`;
this.StalenessProvider = StalenessProvider;
this.worker = new Worker(workerUrl);
this.worker.onmessage = this.onMessage.bind(this);

View File

@@ -19,7 +19,7 @@
this source code distribution or the Licensing information page available
at runtime from the About dialog for additional information.
-->
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
@@ -27,7 +27,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>Open MCT</title>
<script src="dist/openmct.js"></script>
<link
rel="icon"
type="image/png"
@@ -89,7 +88,9 @@
width: 100px;
}
</style>
<script defer>
<script type="module" defer>
import openmct from './dist/openmct.mjs';
const THIRTY_SECONDS = 30 * 1000;
const ONE_MINUTE = THIRTY_SECONDS * 2;
const FIVE_MINUTES = ONE_MINUTE * 5;

View File

@@ -3,7 +3,10 @@
"version": "4.0.0-next",
"description": "The Open MCT core platform",
"type": "module",
"main": "dist/openmct.js",
"module": "./dist/openmct.mjs",
"exports": {
"import": "./dist/openmct.mjs"
},
"devDependencies": {
"@axe-core/playwright": "4.8.2",
"@babel/eslint-parser": "7.23.3",

View File

@@ -223,7 +223,7 @@ class InMemorySearchProvider {
*/
startSharedWorker() {
// eslint-disable-next-line no-undef
const sharedWorkerURL = `${this.openmct.getAssetPath()}${__OPENMCT_ROOT_RELATIVE__}inMemorySearchWorker.js`;
const sharedWorkerURL = `${this.openmct.getAssetPath()}${__OPENMCT_ROOT_RELATIVE__}inMemorySearchWorker.mjs`;
const sharedWorker = new SharedWorker(sharedWorkerURL, 'InMemorySearch Shared Worker');
sharedWorker.onerror = this.onWorkerError;

View File

@@ -58,7 +58,7 @@ class CouchObjectProvider {
let sharedWorker;
// eslint-disable-next-line no-undef
const sharedWorkerURL = `${this.openmct.getAssetPath()}${__OPENMCT_ROOT_RELATIVE__}couchDBChangesFeed.js`;
const sharedWorkerURL = `${this.openmct.getAssetPath()}${__OPENMCT_ROOT_RELATIVE__}couchDBChangesFeed.mjs`;
sharedWorker = new SharedWorker(
sharedWorkerURL,