Created
October 6, 2015 16:10
-
-
Save kristiehoward/b0a94e2cd734fe0da3e1 to your computer and use it in GitHub Desktop.
trying to include buttons
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 ExtractTextPlugin = require("extract-text-webpack-plugin"); | |
var debug = require('debug')('webpack--common'); | |
var fs = require('fs'); | |
var _ = require('lodash'); | |
var cssstats = require('postcss-cssstats'); | |
var loaders = require('./_commonLoaders'); | |
/* Dux Button Config */ | |
var elementButton = require('@dux/element-button/defaults'); | |
var buttons = elementButton.mkButtons([{ | |
name: 'primary', | |
color: '#FFF', | |
bg: '#22B8EB' | |
},{ | |
name: 'secondary', | |
color: '#FFF', | |
bg: '#232C37' | |
},{ | |
name: 'coral', | |
color: '#FFF', | |
bg: '#FF85AF' | |
},{ | |
name: 'success', | |
color: '#FFF', | |
bg: '#0FD85A' | |
},{ | |
name: 'warning', | |
color: '#FFF', | |
bg: '#FF8546' | |
},{ | |
name: 'yellow', | |
color: '#FFF', | |
bg: '#FFDE50' | |
},{ | |
name: 'alert', | |
color: '#FFF', | |
bg: '#EB3E46' | |
}]); | |
/** | |
* cssnaneOpts can be true or an options object | |
* | |
* http://cssnano.co/options/ | |
*/ | |
var cssnanoOpts = { | |
merge: false | |
}; | |
var postCSSImportOpts = true; | |
module.exports = { | |
resolve: { | |
extensions: ['', '.js', '.jsx', '.json'], | |
root: [ | |
'/opt/hub/app/scripts/', | |
'/opt/hub/app/scripts/components' | |
] | |
}, | |
module: { | |
preLoaders: loaders.preLoaders, | |
loaders: loaders.commonLoaders | |
}, | |
postcss: [ | |
require('postcss-constants')({ | |
defaults: _.merge(require('@dux/element-card/defaults')({}), | |
duxElementButton: { | |
radius: '.25rem', | |
buttons: buttons | |
}) | |
}), | |
require('cssnext')({ | |
browsers: 'last 2 versions', | |
import: postCSSImportOpts, | |
compress: cssnanoOpts, | |
messages: false, | |
plugins: [ | |
require('postcss-constants')({ | |
defaults: _.merge(require('@dux/element-card/defaults')({}), | |
duxElementButton: { | |
radius: '.25rem', | |
buttons: buttons | |
}) | |
}), | |
require('postcss-nested'), | |
cssstats(function(stats) { | |
/** | |
* this cssstats callback runs for every postcss file | |
* perhaps we want to write out this object and | |
* record the values over time? | |
* | |
* problem: there is no filename here | |
*/ | |
debug(stats); | |
})] | |
}) | |
], | |
eslint: { | |
failOnError: true | |
}, | |
bail: true, | |
profile: true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment