@@ -12,11 +12,11 @@ var stringHash = require('string-hash');
1212*/
1313function createScopedNameFunc ( plugin ) {
1414 var orig = plugin . generateScopedName ;
15- return function ( name , path , css ) {
15+ return function ( name , filename , css ) {
1616 var hash = stringHash ( css ) . toString ( 36 ) . substr ( 0 , 5 ) ;
1717 return orig . apply ( plugin , arguments ) + '___' + hash ;
18- }
19- } ;
18+ } ;
19+ }
2020
2121/*
2222
@@ -56,9 +56,10 @@ module.exports = function (browserify, options) {
5656 var plugins = options . use || options . u ;
5757 if ( ! plugins ) {
5858 plugins = Core . defaultPlugins ;
59- } else {
59+ }
60+ else {
6061 if ( typeof plugins === 'string' ) {
61- plugins = [ plugins ] ;
62+ plugins = [ plugins ] ;
6263 }
6364 }
6465
@@ -84,7 +85,8 @@ module.exports = function (browserify, options) {
8485
8586 if ( name in options ) {
8687 plugin = plugin ( options [ name ] ) ;
87- } else {
88+ }
89+ else {
8890 plugin = plugin . postcss || plugin ( ) ;
8991 }
9092
@@ -119,7 +121,7 @@ module.exports = function (browserify, options) {
119121 loader . tokensByFile = tokensByFile ;
120122
121123 loader . fetch ( path . relative ( rootDir , filename ) , '/' ) . then ( function ( tokens ) {
122- var output = " module.exports = " + JSON . stringify ( tokens ) ;
124+ var output = ' module.exports = ' + JSON . stringify ( tokens ) ;
123125
124126 assign ( tokensByFile , loader . tokensByFile ) ;
125127
@@ -138,13 +140,12 @@ module.exports = function (browserify, options) {
138140 global : true
139141 } ) ;
140142
141- browserify . on ( 'bundle' , function ( bundle ) {
142- bundle . on ( 'end' , function ( ) {
143+ browserify . on ( 'bundle' , function ( bundle ) {
144+ bundle . on ( 'end' , function ( ) {
143145 // Combine the collected sources into a single CSS file
144- var css = Object . keys ( sourceByFile ) . map ( function ( file ) {
146+ var css = Object . keys ( sourceByFile ) . map ( function ( file ) {
145147 return sourceByFile [ file ] ;
146148 } ) . join ( '\n' ) ;
147- var args = arguments ;
148149
149150 fs . writeFile ( cssOutFilename , css , function ( err ) {
150151 if ( err ) {
0 commit comments