webpack.test.conf.js 552 B

12345678910111213141516171819202122
  1. const config = require('./webpack.base.conf.js');
  2. const webpack = require('webpack');
  3. const path = require('path');
  4. config.externals = {};
  5. config.plugins.push(
  6. new webpack.SourceMapDevToolPlugin({
  7. filename: null, // if no value is provided the sourcemap is inlined
  8. test: /\.(ts|tsx)($|\?)/i // process .js and .ts files only
  9. })
  10. );
  11. config.module.rules.push({
  12. enforce: 'post',
  13. test: /\.(ts|tsx)$/,
  14. loader: 'istanbul-instrumenter-loader',
  15. include: path.resolve('src/'),
  16. exclude: /\.test\.(ts|tsx)$/,
  17. });
  18. module.exports = config;