Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const path = require('path');
- const webpack = require('webpack');
- const conf = {
- frameworks: ['mocha', 'es6-shim'],
- browsers: ['PhantomJS'],
- files: [
- './test.js',
- './node_modules/phantomjs-polyfill-object-assign/object-assign-polyfill.js'
- ],
- preprocessors: {
- './app/tests/*.js': ['coverage'],
- './app/tests/*.jsx': ['coverage'],
- './test.js': ['webpack']
- },
- plugins: ['karma-*'],
- reporters: ['mocha', 'coverage'],
- coverageReporter: {
- dir: './coverage',
- reporters: []
- },
- colors: true,
- autoWatch: true,
- singleRun: false,
- concurrency: Infinity,
- webpack: {
- devtool: 'inline-source-map',
- resolve: {
- extensions: ['.json', '.js', '.jsx']
- },
- module: {
- loaders: [{
- test: /\.js?$/,
- loader: 'imports-loader'
- },
- {
- test: /\.jsx?$/,
- use: 'babel-loader',
- exclude: /node_modules/,
- },
- {
- test: /\.(jpe?g|png|gif)$/i,
- loader: 'url?limit=1000&name=images/[hash].[ext]'
- },
- {
- test: /\.json$/,
- loader: 'json-loader'
- },
- {
- test: /\.css$/,
- include: path.resolve('./src/app'),
- loaders: [
- 'style',
- 'css?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]',
- ]
- },
- {
- test: /\.css$/,
- exclude: path.resolve('./src/app'),
- loader: 'style!css'
- },
- {
- test: /\.svg(\?.*)?$/,
- loader: 'url?limit=10000&mimetype=image/svg+xml&name=h/[hash].[ext]'
- }
- ]
- },
- externals: {
- 'react/lib/ExecutionEnvironment': true,
- 'react/lib/ReactContext': 'window'
- },
- plugins: [
- new webpack.IgnorePlugin(/^fs$/),
- new webpack.IgnorePlugin(/^react\/addons$/),
- new webpack.NoErrorsPlugin(),
- new webpack.DefinePlugin({
- 'process.env': {
- BROWSER: JSON.stringify(true),
- NODE_ENV: JSON.stringify('development')
- }
- })
- ]
- },
- webpackServer: {
- noInfo: true
- }
- };
- module.exports = function(config) {
- conf.logLevel = config.LOG_INFO;
- config.set(conf);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement