2016-04-14 00:28:44 +02:00
|
|
|
const fs = require('fs')
|
2016-06-21 22:56:04 +02:00
|
|
|
const path = require('path')
|
2016-04-14 00:28:44 +02:00
|
|
|
|
|
|
|
module.exports = bundleCss
|
|
|
|
|
|
|
|
var cssFiles = {
|
2016-06-21 22:56:04 +02:00
|
|
|
'fonts.css': fs.readFileSync(path.join(__dirname, '/app/css/fonts.css'), 'utf8'),
|
|
|
|
'reset.css': fs.readFileSync(path.join(__dirname, '/app/css/reset.css'), 'utf8'),
|
|
|
|
'lib.css': fs.readFileSync(path.join(__dirname, '/app/css/lib.css'), 'utf8'),
|
|
|
|
'index.css': fs.readFileSync(path.join(__dirname, '/app/css/index.css'), 'utf8'),
|
|
|
|
'transitions.css': fs.readFileSync(path.join(__dirname, '/app/css/transitions.css'), 'utf8'),
|
2017-07-20 21:50:42 +02:00
|
|
|
'react-tooltip-component.css': fs.readFileSync(path.join(__dirname, '..', 'node_modules', 'react-tooltip-component', 'dist', 'react-tooltip-component.css'), 'utf8'),
|
|
|
|
'react-css': fs.readFileSync(path.join(__dirname, '..', 'node_modules', 'react-select', 'dist', 'react-select.css'), 'utf8'),
|
2016-04-14 00:28:44 +02:00
|
|
|
}
|
|
|
|
|
2016-06-21 22:18:32 +02:00
|
|
|
function bundleCss () {
|
|
|
|
var cssBundle = Object.keys(cssFiles).reduce(function (bundle, fileName) {
|
2016-04-14 00:28:44 +02:00
|
|
|
var fileContent = cssFiles[fileName]
|
|
|
|
var output = String()
|
|
|
|
|
2016-06-21 22:18:32 +02:00
|
|
|
output += '/*========== ' + fileName + ' ==========*/\n\n'
|
2016-04-14 00:28:44 +02:00
|
|
|
output += fileContent
|
|
|
|
output += '\n\n'
|
|
|
|
|
2016-06-21 22:18:32 +02:00
|
|
|
return bundle + output
|
2016-04-14 00:28:44 +02:00
|
|
|
}, String())
|
|
|
|
|
|
|
|
return cssBundle
|
|
|
|
}
|