@@ -4,24 +4,27 @@ import chalk from 'chalk';
44import { map , series } from 'asyncro' ;
55import promisify from 'es6-promisify' ;
66import glob from 'glob' ;
7+ import autoprefixer from 'autoprefixer' ;
78import { rollup , watch } from 'rollup' ;
89import nodent from 'rollup-plugin-nodent' ;
910import commonjs from 'rollup-plugin-commonjs' ;
1011import nodeResolve from 'rollup-plugin-node-resolve' ;
1112import buble from 'rollup-plugin-buble' ;
1213import uglify from 'rollup-plugin-uglify' ;
14+ import postcss from 'rollup-plugin-postcss' ;
1315// import replace from 'rollup-plugin-post-replace';
1416import es3 from 'rollup-plugin-es3' ;
1517import gzipSize from 'gzip-size' ;
1618import prettyBytes from 'pretty-bytes' ;
1719import shebangPlugin from 'rollup-plugin-preserve-shebang' ;
1820import flow from 'rollup-plugin-flow' ;
21+ import camelCase from 'camelcase' ;
1922
2023const readFile = promisify ( fs . readFile ) ;
2124const stat = promisify ( fs . stat ) ;
2225const isDir = name => stat ( name ) . then ( stats => stats . isDirectory ( ) ) . catch ( ( ) => false ) ;
2326const isFile = name => stat ( name ) . then ( stats => stats . isFile ( ) ) . catch ( ( ) => false ) ;
24- const safeVariableName = name => name . replace ( / (?: ^ [ ^ a - z $ _ ] | ( [ ^ a - z 0 - 9 _ $ ] + ) ) / g, '_' ) ;
27+ const safeVariableName = name => camelCase ( name . toLowerCase ( ) . replace ( / ( ( ^ [ ^ a - z A - Z ] + ) | [ ^ \w . - ] ) | ( [ ^ a - z A - Z 0 - 9 ] + $ ) / g, '' ) ) ;
2528
2629const FORMATS = [ 'es' , 'cjs' , 'umd' ] ;
2730
@@ -171,6 +174,12 @@ function createConfig(options, entry, format) {
171174 input : entry ,
172175 external,
173176 plugins : [
177+ postcss ( {
178+ plugins : [
179+ autoprefixer ( )
180+ ] ,
181+ extract : true
182+ } ) ,
174183 flow ( { all : true } ) ,
175184 nodent ( {
176185 exclude : 'node_modules/**' ,
0 commit comments