webpack.test.conf.js 867 B

1234567891011121314151617181920212223242526272829303132
  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 baseWebpackConfig = require('./webpack.base.conf')
  7. const webpackConfig = merge(baseWebpackConfig, {
  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