File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,13 @@ export function findBoilerplate(module: Module): any {
3131 const boilerplates = getBoilerplates ( ) ;
3232 const boilerplate = boilerplates . find ( b => {
3333 const regex = new RegExp ( b . condition ) ;
34- return regex . test ( module . title ) ;
34+ return regex . test ( module . path ) ;
3535 } ) ;
3636
3737 if ( boilerplate == null ) {
3838 throw new Error (
3939 `No boilerplate found for ${
40- module . title
40+ module . path
4141 } , you can create one in the future`
4242 ) ;
4343 }
Original file line number Diff line number Diff line change @@ -158,8 +158,14 @@ async function compile({
158158 debug ( `Evaluation time: ${ Date . now ( ) - tt } ms` ) ;
159159 const domChanged = oldHTML !== document . body . innerHTML ;
160160
161- if ( isModuleView && ! domChanged && ! module . title . endsWith ( '.html' ) ) {
162- const isReact = module . code && module . code . includes ( 'React' ) ;
161+ if (
162+ isModuleView &&
163+ ! domChanged &&
164+ ! managerModuleToTranspile . path . endsWith ( '.html' )
165+ ) {
166+ const isReact =
167+ managerModuleToTranspile . code &&
168+ managerModuleToTranspile . code . includes ( 'React' ) ;
163169
164170 if ( isReact ) {
165171 // initiate boilerplates
@@ -171,7 +177,7 @@ async function compile({
171177 }
172178 }
173179
174- const boilerplate = findBoilerplate ( module ) ;
180+ const boilerplate = findBoilerplate ( managerModuleToTranspile ) ;
175181 if ( boilerplate ) {
176182 try {
177183 boilerplate . module . default ( evalled ) ;
You can’t perform that action at this time.
0 commit comments