1 | var path = require('path');
|
2 |
|
3 | module.exports = function(config) {
|
4 | config.set({
|
5 | basePath: '',
|
6 | browsers: [ 'Chrome' ],
|
7 | frameworks: ['jasmine'],
|
8 | files: [
|
9 | 'tests/**/*.js'
|
10 | ],
|
11 |
|
12 | preprocessors: {
|
13 |
|
14 | 'src/**/*.js': ['webpack'],
|
15 | 'tests/**/*.js': ['webpack']
|
16 | },
|
17 |
|
18 | webpack: {
|
19 | module: {
|
20 | loaders: [
|
21 | {
|
22 | test: /\.js$/,
|
23 | loader: 'babel',
|
24 | exclude: path.resolve(__dirname, 'node_modules')
|
25 | },
|
26 | {
|
27 | test: /\.scss$/,
|
28 | loader: "style!css!sass",
|
29 | exclude : /node_modules/
|
30 | },
|
31 | {
|
32 | test: /\.json$/,
|
33 | loader: 'json',
|
34 | },
|
35 | {
|
36 | test: /\.(jpe?g|png|gif)$/i,
|
37 | loader: 'file-loader'
|
38 | },
|
39 | {
|
40 | test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
|
41 | loader: "url?limit=30000&name=[name]-[hash].[ext]"
|
42 | },
|
43 | {
|
44 | test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
|
45 | loader: "url?limit=30000&name=[name]-[hash].[ext]"
|
46 | },
|
47 | {
|
48 | test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
|
49 | loader: "url?limit=30000&name=[name]-[hash].[ext]"
|
50 | },
|
51 | {
|
52 | test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
|
53 | loader: "url?limit=30000&name=[name]-[hash].[ext]"
|
54 | },
|
55 | {
|
56 | test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
|
57 | loader: "url?limit=10000&mimetype=image/svg+xml"
|
58 | }
|
59 | ]
|
60 | },
|
61 | externals: {
|
62 | 'react/lib/ExecutionEnvironment': true,
|
63 | 'react/lib/ReactContext': true
|
64 | }
|
65 | },
|
66 |
|
67 | webpackServer: {
|
68 | noInfo: true
|
69 | },
|
70 |
|
71 | plugins: [
|
72 | 'karma-webpack',
|
73 | 'karma-jasmine',
|
74 | 'karma-chrome-launcher'
|
75 | ],
|
76 |
|
77 | reporters: ['progress'],
|
78 | port: 9876,
|
79 | colors: true,
|
80 | logLevel: config.LOG_INFO,
|
81 | autoWatch: true,
|
82 | browsers: ['Chrome'],
|
83 | singleRun: false,
|
84 | })
|
85 | };
|