Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. const path = require('path');
  2. const webpack = require('webpack');
  3.  
  4. const conf = {
  5. frameworks: ['mocha', 'es6-shim'],
  6.  
  7. browsers: ['PhantomJS'],
  8.  
  9. files: [
  10. './test.js',
  11. './node_modules/phantomjs-polyfill-object-assign/object-assign-polyfill.js'
  12. ],
  13.  
  14. preprocessors: {
  15. './app/tests/*.js': ['coverage'],
  16. './app/tests/*.jsx': ['coverage'],
  17. './test.js': ['webpack']
  18. },
  19.  
  20. plugins: ['karma-*'],
  21.  
  22. reporters: ['mocha', 'coverage'],
  23.  
  24. coverageReporter: {
  25. dir: './coverage',
  26. reporters: []
  27. },
  28.  
  29. colors: true,
  30.  
  31. autoWatch: true,
  32.  
  33. singleRun: false,
  34.  
  35. concurrency: Infinity,
  36.  
  37. webpack: {
  38. devtool: 'inline-source-map',
  39.  
  40. resolve: {
  41. extensions: ['.json', '.js', '.jsx']
  42. },
  43.  
  44. module: {
  45. loaders: [{
  46. test: /\.js?$/,
  47. loader: 'imports-loader'
  48. },
  49. {
  50. test: /\.jsx?$/,
  51. use: 'babel-loader',
  52. exclude: /node_modules/,
  53. },
  54. {
  55. test: /\.(jpe?g|png|gif)$/i,
  56. loader: 'url?limit=1000&name=images/[hash].[ext]'
  57. },
  58. {
  59. test: /\.json$/,
  60. loader: 'json-loader'
  61. },
  62. {
  63. test: /\.css$/,
  64. include: path.resolve('./src/app'),
  65. loaders: [
  66. 'style',
  67. 'css?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]',
  68. ]
  69. },
  70. {
  71. test: /\.css$/,
  72. exclude: path.resolve('./src/app'),
  73. loader: 'style!css'
  74. },
  75. {
  76. test: /\.svg(\?.*)?$/,
  77. loader: 'url?limit=10000&mimetype=image/svg+xml&name=h/[hash].[ext]'
  78. }
  79. ]
  80. },
  81.  
  82. externals: {
  83. 'react/lib/ExecutionEnvironment': true,
  84. 'react/lib/ReactContext': 'window'
  85. },
  86.  
  87. plugins: [
  88. new webpack.IgnorePlugin(/^fs$/),
  89. new webpack.IgnorePlugin(/^react\/addons$/),
  90. new webpack.NoErrorsPlugin(),
  91. new webpack.DefinePlugin({
  92. 'process.env': {
  93. BROWSER: JSON.stringify(true),
  94. NODE_ENV: JSON.stringify('development')
  95. }
  96. })
  97. ]
  98. },
  99.  
  100. webpackServer: {
  101. noInfo: true
  102. }
  103. };
  104.  
  105. module.exports = function(config) {
  106. conf.logLevel = config.LOG_INFO;
  107. config.set(conf);
  108. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement