File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
crates/cli-support/src/js Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -56,9 +56,17 @@ impl<'a> Context<'a> {
56
56
let contents = deindent ( contents) ;
57
57
let contents = contents. trim ( ) ;
58
58
let global = if self . config . nodejs {
59
- format ! ( "module.exports.{} = {};\n " , name, contents)
59
+ if contents. starts_with ( "class" ) {
60
+ format ! ( "{1}\n module.exports.{0} = {0};\n " , name, contents)
61
+ } else {
62
+ format ! ( "module.exports.{} = {};\n " , name, contents)
63
+ }
60
64
} else if self . config . no_modules {
61
- format ! ( "__exports.{} = {}\n " , name, contents)
65
+ if contents. starts_with ( "class" ) {
66
+ format ! ( "{1}\n __exports.{0} = {0};\n " , name, contents)
67
+ } else {
68
+ format ! ( "__exports.{} = {};\n " , name, contents)
69
+ }
62
70
} else {
63
71
if contents. starts_with ( "function" ) {
64
72
format ! ( "export function {}{}\n " , name, & contents[ 8 ..] )
You can’t perform that action at this time.
0 commit comments