webpack.test.config.js 931 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. var path = require('path')
  2. var webpack = require('webpack')
  3. module.exports = {
  4. entry: './test/unit/specs/index.js',
  5. output: {
  6. path: path.resolve(__dirname, '../test/unit'),
  7. filename: 'specs.js'
  8. },
  9. resolve: {
  10. alias: {
  11. src: path.resolve(__dirname, '../src')
  12. }
  13. },
  14. module: {
  15. loaders: [
  16. {
  17. test: /\.js$/,
  18. loader: 'babel',
  19. // NOTE: use absolute path to make sure
  20. // running tests is OK even if it is in node_modules of other project
  21. exclude: [
  22. path.resolve(__dirname, '../test/unit'),
  23. path.resolve(__dirname, '../node_modules')
  24. ]
  25. }
  26. ]
  27. },
  28. babel: {
  29. loose: 'all',
  30. optional: ['runtime']
  31. },
  32. plugins: [
  33. new webpack.DefinePlugin({
  34. 'process.env': {
  35. NODE_ENV: '"development"'
  36. }
  37. })
  38. ],
  39. devServer: {
  40. contentBase: './test/unit',
  41. noInfo: true
  42. },
  43. devtool: 'source-map'
  44. }