Last active
September 28, 2015 10:29
-
-
Save catalinmiron/af7c4c5194f4dbb3ed34 to your computer and use it in GitHub Desktop.
mocha reporter enhancement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* globals window, document */ | |
var React = require('react'), | |
Report = require('./components/report.jsx'), | |
mochaTestDataVarName = require('../lib/mocha-test-data-var-name.js'); | |
require('./../node_modules/bootstrap/dist/css/bootstrap.min.css') | |
require('./styles/base.css'); | |
var data = window[mochaTestDataVarName]; | |
React.render(<Report data={data}/>, document.body); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/> | |
<title>{%= o.htmlWebpackPlugin.options.title %}</title> | |
{% if (o.htmlWebpackPlugin.files.favicon) { %} | |
<link rel="shortcut icon" href="{%=o.htmlWebpackPlugin.files.favicon%}"> | |
{% } %} | |
{% for (var css in o.htmlWebpackPlugin.files.css) { %} | |
<link href="{%=o.htmlWebpackPlugin.files.css[css] %}" rel="stylesheet"> | |
{% } %} | |
<script src="{%= o.htmlWebpackPlugin.options.customScript %}"></script> | |
</head> | |
<body> | |
{% for (var chunk in o.htmlWebpackPlugin.files.chunks) { %} | |
<script src="{%=o.htmlWebpackPlugin.files.chunks[chunk].entry %}"></script> | |
{% } %} | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var HtmlWebpackPlugin = require('html-webpack-plugin'), | |
ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
module.exports = { | |
entry: { | |
bundle: './ui/entry.jsx', | |
}, | |
output: { | |
path: 'statics/', | |
filename: '[name].js' | |
}, | |
module: { | |
loaders: [{ | |
test: /\.jsx?$/, | |
loader: 'babel-loader' | |
}, { | |
test: /\.css/, | |
loader: ExtractTextPlugin.extract('style-loader', 'css-loader') | |
}, { | |
test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/, | |
loader: 'url?limit=10000&mimetype=application/font-woff' | |
}, { | |
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, | |
loader: 'url?limit=10000&mimetype=application/octet-stream' | |
}, { | |
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, | |
loader: 'file' | |
}, { | |
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, | |
loader: 'url?limit=10000&mimetype=image/svg+xml' | |
}] | |
}, | |
plugins: [ | |
new ExtractTextPlugin('[name].css', { | |
allChunks: true | |
}), | |
new HtmlWebpackPlugin({ | |
title: 'Mughsot Visual Report', | |
charset: 'utf-8', | |
template: './index.html', | |
customScript: '../data.js' | |
}) | |
] | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm i --save-dev url-loader file-loader html-webpack-plugin extract-text-webpack-plugin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment