2022-09-30 15:17:02 +00:00
|
|
|
/* 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.
|
|
|
|
*/
|
2021-12-30 00:18:48 +00:00
|
|
|
const { merge } = require('webpack-merge');
|
|
|
|
const common = require('./webpack.common');
|
|
|
|
|
|
|
|
const path = require('path');
|
|
|
|
const webpack = require('webpack');
|
|
|
|
|
|
|
|
module.exports = merge(common, {
|
|
|
|
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: [
|
|
|
|
'**/{node_modules,dist,docs,e2e}', // All files in node_modules, dist, docs, e2e,
|
2022-09-30 17:32:11 +00:00
|
|
|
'**/{*.yml,Procfile,webpack*.js,babel*.js,package*.json,tsconfig.json}', // Config files
|
2022-06-13 15:40:37 +00:00
|
|
|
'**/*.{sh,md,png,ttf,woff,svg}', // Non source files
|
|
|
|
'**/.*' // dotfiles and dotfolders
|
|
|
|
]
|
|
|
|
},
|
2021-12-30 00:18:48 +00:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
"vue": path.join(__dirname, "node_modules/vue/dist/vue.js")
|
|
|
|
}
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
__OPENMCT_ROOT_RELATIVE__: '"dist/"'
|
|
|
|
})
|
|
|
|
],
|
2022-09-30 15:17:02 +00:00
|
|
|
devtool: 'eval-source-map',
|
|
|
|
devServer: {
|
2022-10-04 17:53:44 +00:00
|
|
|
devMiddleware: {
|
|
|
|
writeToDisk: (filePathString) => {
|
|
|
|
const filePath = path.parse(filePathString);
|
|
|
|
const shouldWrite = !(filePath.base.includes('hot-update'));
|
|
|
|
|
|
|
|
return shouldWrite;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
watchFiles: ['**/*.css'],
|
2022-09-30 15:17:02 +00:00
|
|
|
static: {
|
2022-10-04 17:53:44 +00:00
|
|
|
directory: path.join(__dirname, '/dist'),
|
|
|
|
publicPath: '/dist',
|
|
|
|
watch: false
|
2022-09-30 15:17:02 +00:00
|
|
|
},
|
|
|
|
client: {
|
|
|
|
progress: true,
|
|
|
|
overlay: true
|
|
|
|
}
|
|
|
|
}
|
2021-12-30 00:18:48 +00:00
|
|
|
});
|