webpack.test.conf.js 854 B

123456789101112131415161718192021222324252627282930313233
  1. 'use strict'
  2. // This is the webpack config used for unit tests.
  3. const utils = require('./utils')
  4. const webpack = require('webpack')
  5. const merge = require('webpack-merge')
  6. const baseConfig = require('./webpack.base.conf')
  7. const webpackConfig = merge(baseConfig, {
  8. // use inline sourcemap for karma-sourcemap-loader
  9. module: {
  10. rules: utils.styleLoaders()
  11. },
  12. devtool: '#inline-source-map',
  13. resolveLoader: {
  14. alias: {
  15. // necessary to to make lang="scss" work in test when using vue-loader's ?inject option
  16. // see discussion at https://github.com/vuejs/vue-loader/issues/724
  17. 'scss-loader': 'sass-loader'
  18. }
  19. },
  20. plugins: [
  21. new webpack.DefinePlugin({
  22. 'process.env': require('../config/test.env')
  23. })
  24. ]
  25. })
  26. // no need for app entry during tests
  27. delete webpackConfig.entry
  28. module.exports = webpackConfig