2022-09-30 15:17:02 +00:00
|
|
|
/*
|
|
|
|
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.
|
2024-03-28 21:49:00 +00:00
|
|
|
If OpenMCT is to be used for a production server, use webpack.prod.mjs instead.
|
2022-09-30 15:17:02 +00:00
|
|
|
*/
|
2024-03-28 21:49:00 +00:00
|
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
|
2024-01-02 15:24:22 +00:00
|
|
|
import path from 'path';
|
|
|
|
import webpack from 'webpack';
|
|
|
|
import { merge } from 'webpack-merge';
|
2023-01-17 16:05:34 +00:00
|
|
|
|
2024-03-28 21:49:00 +00:00
|
|
|
import common from './webpack.common.mjs';
|
2021-12-30 00:18:48 +00:00
|
|
|
|
2024-01-02 15:24:22 +00:00
|
|
|
export default merge(common, {
|
2023-01-12 19:46:35 +00:00
|
|
|
mode: 'development',
|
2022-06-13 15:40:37 +00:00
|
|
|
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: [
|
2023-01-12 19:46:35 +00:00
|
|
|
'**/{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
|
2022-06-13 15:40:37 +00:00
|
|
|
]
|
2023-05-18 21:54:46 +00:00
|
|
|
},
|
2021-12-30 00:18:48 +00:00
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
__OPENMCT_ROOT_RELATIVE__: '"dist/"'
|
2023-05-18 21:54:46 +00:00
|
|
|
})
|
|
|
|
],
|
2023-01-12 19:46:35 +00:00
|
|
|
devtool: 'eval-source-map',
|
2022-09-30 15:17:02 +00:00
|
|
|
devServer: {
|
2022-10-04 17:53:44 +00:00
|
|
|
devMiddleware: {
|
|
|
|
writeToDisk: (filePathString) => {
|
|
|
|
const filePath = path.parse(filePathString);
|
2023-01-12 19:46:35 +00:00
|
|
|
const shouldWrite = !filePath.base.includes('hot-update');
|
2023-05-18 21:54:46 +00:00
|
|
|
|
2022-10-04 17:53:44 +00:00
|
|
|
return shouldWrite;
|
2023-05-18 21:54:46 +00:00
|
|
|
}
|
2022-06-13 15:40:37 +00:00
|
|
|
},
|
2024-07-24 03:41:07 +00:00
|
|
|
watchFiles: ['src/**/*.css', 'example/**/*.css'],
|
2021-12-30 00:18:48 +00:00
|
|
|
static: {
|
2024-01-02 15:24:22 +00:00
|
|
|
directory: fileURLToPath(new URL('../dist', import.meta.url)),
|
2023-01-12 19:46:35 +00:00
|
|
|
publicPath: '/dist',
|
2022-10-04 17:53:44 +00:00
|
|
|
watch: false
|
2022-09-30 15:17:02 +00:00
|
|
|
}
|
2023-05-18 21:54:46 +00:00
|
|
|
}
|
2021-12-30 00:18:48 +00:00
|
|
|
});
|