Replace app.js with webpack-dev-server (#5797)
This commit is contained in:
@@ -1,34 +1,21 @@
|
||||
// This file extends the webpack.dev.js config to add istanbul coverage
|
||||
// instrumentation using babel-plugin-istanbul (see babel.coverage.js)
|
||||
/* global module */
|
||||
|
||||
/*
|
||||
This file extends the webpack.dev.js config to add babel istanbul coverage.
|
||||
OpenMCT Continuous Integration servers use this configuration to add code coverage
|
||||
information to pull requests.
|
||||
*/
|
||||
|
||||
const config = require('./webpack.dev');
|
||||
const vueLoaderRule = config.module.rules.find(r => r.use === 'vue-loader');
|
||||
// eslint-disable-next-line no-undef
|
||||
const CI = process.env.CI === 'true';
|
||||
|
||||
config.devtool = CI ? false : undefined;
|
||||
|
||||
vueLoaderRule.use = {
|
||||
loader: 'vue-loader'
|
||||
// Attempt to use Babel with babel-plugin-istanbul
|
||||
|
||||
// TODO The purpose of this was to try to add coverage to JS expressions
|
||||
// inside `<template>` markup, but it seems to add only coverage inside
|
||||
// `<script>` tags.
|
||||
// Issue: https://github.com/nasa/openmct/issues/4973
|
||||
//
|
||||
// options: {
|
||||
// compiler: require('vue-template-babel-compiler'),
|
||||
// compilerOptions: {
|
||||
// babelOptions: require('./babel.coverage')
|
||||
// }
|
||||
// }
|
||||
};
|
||||
config.devServer.hot = false;
|
||||
|
||||
config.module.rules.push({
|
||||
test: /\.js$/,
|
||||
// test: /(\.js$)|(\?vue&type=template)/,
|
||||
// exclude: /node_modules(?!.*\.vue)/,
|
||||
exclude: /(Spec\.js$)|(node_modules)/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
|
||||
Reference in New Issue
Block a user