File tree Expand file tree Collapse file tree 1 file changed +66
-0
lines changed Expand file tree Collapse file tree 1 file changed +66
-0
lines changed Original file line number Diff line number Diff line change 1+ var pkg = require ( './package.json' ) ;
2+ var path = require ( 'path' ) ;
3+ var webpack = require ( 'webpack' ) ;
4+ var ExtractTextPlugin = require ( 'extract-text-webpack-plugin' ) ;
5+ var nib = require ( 'nib' ) ;
6+
7+ module . exports = {
8+ devtool : 'source-map' ,
9+ entry : {
10+ 'react-buttons' : path . resolve ( __dirname , 'src/index.js' )
11+ } ,
12+ output : {
13+ path : path . join ( __dirname , 'lib' ) ,
14+ filename : 'index.js' ,
15+ libraryTarget : 'commonjs2'
16+ } ,
17+ externals : Object . keys ( pkg . dependencies ) ,
18+ module : {
19+ preLoaders : [
20+ // http://survivejs.com/webpack_react/linting_in_webpack/
21+ {
22+ test : / \. j s x ? $ / ,
23+ loaders : [ 'eslint' ] ,
24+ exclude : / n o d e _ m o d u l e s /
25+ } ,
26+ {
27+ test : / \. s t y l $ / ,
28+ loader : 'stylint'
29+ }
30+ ] ,
31+ loaders : [
32+ {
33+ test : / \. j s o n $ / ,
34+ loader : 'json'
35+ } ,
36+ {
37+ test : / \. j s x ? $ / ,
38+ loader : 'babel' ,
39+ exclude : / ( n o d e _ m o d u l e s | b o w e r _ c o m p o n e n t s ) /
40+ } ,
41+ {
42+ test : / \. s t y l $ / ,
43+ loader : ExtractTextPlugin . extract (
44+ 'style' ,
45+ 'css?-autoprefixer&modules&importLoaders=1&localIdentName=buttons---[local]---[hash:base64:5]!stylus'
46+ )
47+ } ,
48+ {
49+ test : / \. c s s $ / ,
50+ loader : 'style!css?-autoprefixer'
51+ }
52+ ]
53+ } ,
54+ stylus : {
55+ // nib - CSS3 extensions for Stylus
56+ use : [ nib ( ) ] ,
57+ // no need to have a '@import "nib"' in the stylesheet
58+ import : [ '~nib/lib/nib/index.styl' ]
59+ } ,
60+ plugins : [
61+ new ExtractTextPlugin ( '../dist/react-buttons.css' )
62+ ] ,
63+ resolve : {
64+ extensions : [ '' , '.js' , '.jsx' ]
65+ }
66+ } ;
You can’t perform that action at this time.
0 commit comments