Skip to content

Instantly share code, notes, and snippets.

@skayred
Last active September 22, 2017 10:03
Show Gist options
  • Save skayred/0630f7e4c06c910da144f1e999aa8c58 to your computer and use it in GitHub Desktop.
Save skayred/0630f7e4c06c910da144f1e999aa8c58 to your computer and use it in GitHub Desktop.
var path = require('path');
var webpack = require('webpack');
var postcssAssets = require('postcss-assets');
var postcssNext = require('postcss-cssnext');
const conf = {
frameworks: ['mocha', 'karma-typescript', 'es6-shim'],
browsers: ['PhantomJS'],
files: [
'./config/webpack/test.js',
'./node_modules/phantomjs-polyfill-object-assign/object-assign-polyfill.js'
],
preprocessors: {
'./src/app/tests/*.ts': ['coverage', 'karma-typescript'],
'./src/app/tests/*.tsx': ['coverage', 'karma-typescript'],
'./config/webpack/test.js': ['webpack']
},
plugins: ['karma-*'],
reporters: ['mocha', 'coverage', 'karma-typescript'],
coverageReporter: {
dir: './coverage',
reporters: []
},
colors: true,
autoWatch: true,
singleRun: false,
concurrency: Infinity,
webpack: {
devtool: 'inline-source-map',
resolve: {
root: path.resolve(__dirname),
modulesDirectories: [
'./src',
'node_modules'
],
extensions: ['', '.json', '.js', '.ts', '.tsx']
},
module: {
loaders: [{
test: /\.tsx?$/,
loader: 'ts'
},
{
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]',
'postcss'
]
},
{
test: /\.css$/,
exclude: path.resolve('./src/app'),
loader: 'style!css'
},
{
test: /\.svg(\?.*)?$/,
loader: 'url?limit=10000&mimetype=image/svg+xml&name=h/[hash].[ext]'
}
],
postLoaders: [{
test: /\.tsx?$/,
loader: 'istanbul-instrumenter-loader',
include: path.resolve('./src/app')
}]
},
postcss: function() {
return [
postcssNext(),
postcssAssets({ relative: true })
];
},
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
}
};
if (process.env.NODE_ENV === 'ci') {
conf.autoWatch = false;
conf.singleRun = true;
conf.browsers.push('Firefox');
conf.coverageReporter.reporters.push({ type: 'lcov', subdir: '.' });
} else {
conf.coverageReporter.reporters.push({ type: 'html', subdir: 'html' });
};
module.exports = function(config) {
conf.logLevel = config.LOG_INFO;
config.set(conf);
};
"devDependencies": {
"chai": "^3.5.0",
"classnames": "^2.2.4",
"compression-webpack-plugin": "^0.3.2",
"cross-env": "^3.1.2",
"css-loader": "^0.25.0",
"enzyme": "^2.3.0",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.9.0",
"isomorphic-style-loader": "^1.0.0",
"istanbul-instrumenter-loader": "^1.0.0",
"json-loader": "^0.5.4",
"karma": "^0.13.22",
"karma-coverage": "^1.1.1",
"karma-es6-shim": "^1.0.0",
"karma-mocha": "^1.2.0",
"karma-mocha-reporter": "^2.2.0",
"karma-phantomjs-launcher": "^1.0.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-typescript": "^2.1.7",
"karma-typescript-preprocessor": "^0.3.0",
"karma-webpack": "^1.7.0",
"mocha": "^3.1.0",
"phantomjs-polyfill-object-assign": "0.0.2",
"phantomjs-prebuilt": "^2.1.7",
"postcss-assets": "^4.1.0",
"postcss-cssnext": "^2.6.0",
"postcss-loader": "^0.13.0",
"react-addons-test-utils": "^15.0.1",
"react-hot-loader": "^3.0.0-beta.5",
"redux-mock-store": "^1.2.2",
"rimraf": "^2.5.2",
"sinon": "^2.0.0-pre.3",
"style-loader": "^0.13.1",
"stylelint": "^7.4.2",
"ts-loader": "^0.9.0",
"tslint": "^4.1.1",
"tslint-microsoft-contrib": "^4.0.0",
"typescript": "2.3.4",
"typings": "^1.4.0",
"url-loader": "^0.5.7",
"webpack": "^1.13.0",
"webpack-dev-middleware": "^1.6.1",
"webpack-hot-middleware": "^2.10.0",
"webpack-manifest-plugin": "^1.0.1"
},
"dependencies": {
"@cian/adfox": "^3.3.2",
"@cian/base-css": "^0.17.2",
"@cian/components": "^9.2.0",
"@cian/metrics": "^1.1.0",
"@cian/network-framework": "^0.2.4",
"@cian/sentry": "^1.1.2",
"@cian/utils": "^2.0.0",
"@types/cookie-parser": "^1.3.30",
"@types/lodash.difference": "^4.5.2",
"@types/lodash.differencewith": "^4.5.2",
"@types/lodash.filter": "^4.6.1",
"@types/lodash.find": "^4.6.1",
"@types/lodash.findkey": "^4.6.1",
"@types/lodash.first": "^3.0.1",
"@types/lodash.flatten": "^4.4.1",
"@types/lodash.foreach": "^4.5.1",
"@types/lodash.get": "^4.4.1",
"@types/lodash.includes": "^4.3.1",
"@types/lodash.intersection": "^4.4.1",
"@types/lodash.isempty": "^4.4.1",
"@types/lodash.isequal": "^4.5.0",
"@types/lodash.join": "^4.0.1",
"@types/lodash.matchesproperty": "^4.7.1",
"@types/lodash.pick": "^4.4.1",
"@types/lodash.pickby": "^4.6.1",
"@types/lodash.sortby": "^4.7.1",
"@types/lodash.topairs": "^4.3.1",
"@types/node": "^6.0.45",
"@types/qs": "^6.2.31",
"@types/react": "15.0.2",
"@types/react-dom": "0.14.23",
"babel-runtime": "^6.11.6",
"body-parser": "^1.15.2",
"cookie-parser": "^1.4.3",
"copy-webpack-plugin": "^4.0.1",
"express": "^4.13.4",
"express-http-proxy": "^0.10.1",
"lodash.differencewith": "^4.5.0",
"lodash.filter": "^4.6.0",
"lodash.find": "^4.6.0",
"lodash.findkey": "^4.6.0",
"lodash.first": "^3.0.0",
"lodash.flatten": "^4.4.0",
"lodash.foreach": "^4.5.0",
"lodash.get": "^4.4.2",
"lodash.includes": "^4.3.0",
"lodash.intersection": "^4.4.0",
"lodash.isempty": "^4.4.0",
"lodash.isequal": "^4.5.0",
"lodash.join": "^4.0.1",
"lodash.map": "^4.6.0",
"lodash.matchesproperty": "^4.7.0",
"lodash.pick": "^4.4.0",
"lodash.pickby": "^4.6.0",
"lodash.sortby": "^4.7.0",
"lodash.topairs": "^4.3.0",
"node-statsd": "^0.1.1",
"normalize.css": "^5.0.0",
"on-finished": "^2.3.0",
"qs": "^6.4.0",
"quill": "https://github.com/skayred/quill.git",
"quill-delta": "^3.5.0",
"raven": "^0.12.3",
"react": "^15.0.1",
"react-dom": "^15.0.1",
"react-input-mask": "^0.7.5",
"react-load-script": "0.0.4",
"react-quill": "^1.0.0-rc.2",
"react-redux": "^4.4.5",
"react-router": "^3.0.2",
"react-router-redux": "^4.0.8",
"redux": "3.5.2",
"redux-connect": "^5.0.0",
"redux-logger": "^2.6.1",
"redux-thunk": "2.1.0",
"request": "^2.75.0",
"rxjs": "^5.0.0-rc.2",
"translit": "0.0.1",
"translit-russian": "0.0.2"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment