mirror of
https://github.com/nasa/openmct.git
synced 2024-12-18 20:57:53 +00:00
4885c816dc
* Replacing all instances of the new Vue() component creation pattern * In Vue 3, components cannot be created on the fly and mounted off-DOM. The suggested fix from Vue is to use createApp, but in the context of Open MCT this means dozens of Vue apps being created and destroyed at any given moment. Instead, we have used a community hack for creating individual components. * beforeDestroy() -> beforeUnmount() * destroyed() -> unmounted() * The addition of deep: true option on Array listeners is now required to detect Array changes * Open MCT is now mounted on a child div instead of directly on document.body --------- Co-authored-by: Scott Bell <scott@traclabs.com> Co-authored-by: Andrew Henry <akhenry@gmail.com> Co-authored-by: John Hill <john.c.hill@nasa.gov>
59 lines
1.8 KiB
JavaScript
59 lines
1.8 KiB
JavaScript
/* global __dirname module */
|
|
|
|
/*
|
|
This configuration should be used for development purposes. It contains full source map, a
|
|
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.
|
|
*/
|
|
const path = require('path');
|
|
const webpack = require('webpack');
|
|
const { merge } = require('webpack-merge');
|
|
|
|
const common = require('./webpack.common');
|
|
const projectRootDir = path.resolve(__dirname, '..');
|
|
|
|
module.exports = merge(common, {
|
|
mode: 'development',
|
|
watchOptions: {
|
|
// Since we use require.context, webpack is watching the entire directory.
|
|
// We need to exclude any files we don't want webpack to watch.
|
|
// See: https://webpack.js.org/configuration/watch/#watchoptions-exclude
|
|
ignored: [
|
|
'**/{node_modules,dist,docs,e2e}', // All files in node_modules, dist, docs, e2e,
|
|
'**/{*.yml,Procfile,webpack*.js,babel*.js,package*.json,tsconfig.json}', // Config files
|
|
'**/*.{sh,md,png,ttf,woff,svg}', // Non source files
|
|
'**/.*' // dotfiles and dotfolders
|
|
]
|
|
},
|
|
plugins: [
|
|
new webpack.DefinePlugin({
|
|
__OPENMCT_ROOT_RELATIVE__: '"dist/"'
|
|
})
|
|
],
|
|
devtool: 'eval-source-map',
|
|
devServer: {
|
|
devMiddleware: {
|
|
writeToDisk: (filePathString) => {
|
|
const filePath = path.parse(filePathString);
|
|
const shouldWrite = !filePath.base.includes('hot-update');
|
|
|
|
return shouldWrite;
|
|
}
|
|
},
|
|
watchFiles: ['**/*.css'],
|
|
static: {
|
|
directory: path.join(__dirname, '..', '/dist'),
|
|
publicPath: '/dist',
|
|
watch: false
|
|
},
|
|
client: {
|
|
progress: true,
|
|
overlay: {
|
|
// Disable overlay for runtime errors.
|
|
// See: https://github.com/webpack/webpack-dev-server/issues/4771
|
|
runtimeErrors: false
|
|
}
|
|
}
|
|
}
|
|
});
|