webpack.test.conf.js 855 B

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