@@ -48,7 +48,7 @@ const EVENT_HANDLER_METHODS = [
4848
4949const PLACEHOLDER = '@@@PLACEHOLDER@@@' ;
5050
51- function transformPath ( componentPath ) {
51+ function transformPath ( componentPath , options ) {
5252 let debug = ( fmt , ...args ) => _debug ( `${ componentPath } : ${ fmt } ` , ...args ) ;
5353
5454 let templatePath = guessTemplatePath ( componentPath ) ;
@@ -60,7 +60,7 @@ function transformPath(componentPath) {
6060 let source = fs . readFileSync ( componentPath , 'utf8' ) ;
6161 let template = fs . readFileSync ( templatePath , 'utf8' ) ;
6262
63- let result = transform ( source , template , { debug } ) ;
63+ let result = transform ( source , template , Object . assign ( { } , { debug } , options ) ) ;
6464
6565 if ( result . tagName ) {
6666 fs . writeFileSync ( componentPath , result . source , 'utf8' ) ;
@@ -178,6 +178,9 @@ function transform(source, template, options = {}) {
178178
179179 // wrap existing template with root element
180180 let classNodes = [ ] ;
181+ if ( options . hasComponentCSS ) {
182+ classNodes . push ( b . mustache ( 'styleNamespace' ) ) ;
183+ }
181184 for ( let className of classNames ) {
182185 classNodes . push ( b . text ( className ) ) ;
183186 }
0 commit comments