@@ -43,7 +43,7 @@ const isPug = (filename) => {
43
43
}
44
44
45
45
const compile = ( filename , basedir ) => {
46
- const levels = filename . replace ( ' pug/ views/' , '' ) . replace ( ' pug/ pages/' , '' ) . split ( '/' ) . length
46
+ const levels = filename . replace ( ` pug${ path . sep } views${ path . sep } ` , '' ) . replace ( ` pug${ path . sep } pages${ path . sep } ` , '' ) . split ( ` ${ path . sep } ` ) . length
47
47
const base = ( levels ) => {
48
48
let path = './'
49
49
while ( levels > 1 ) {
@@ -83,9 +83,9 @@ const compileHtml = () => {
83
83
const html = compile ( view , './pug/layout/' )
84
84
let file
85
85
if ( version === 'ajax' ) {
86
- file = view . replace ( ' pug/' , '' ) . replace ( '.pug' , '.html' )
86
+ file = view . replace ( ` pug${ path . sep } ` , '' ) . replace ( '.pug' , '.html' )
87
87
} else {
88
- file = view . replace ( ' pug/ views/' , '' ) . replace ( '.pug' , '.html' )
88
+ file = view . replace ( ` pug${ path . sep } views${ path . sep } ` , '' ) . replace ( '.pug' , '.html' )
89
89
}
90
90
// Create tree
91
91
mkdirp . sync ( resolve ( dest , dirname ( file ) ) )
@@ -103,7 +103,7 @@ const compileHtml = () => {
103
103
pages . forEach ( ( page ) => {
104
104
if ( isPug ( page ) ) {
105
105
const html = compile ( page , './pug/layout/' )
106
- const file = page . replace ( ' pug/ pages/' , '' ) . replace ( '.pug' , '.html' )
106
+ const file = page . replace ( ` pug${ path . sep } pages${ path . sep } ` , '' ) . replace ( '.pug' , '.html' )
107
107
// Create tree
108
108
mkdirp . sync ( resolve ( dest , dirname ( file ) ) )
109
109
// Create HTML file
0 commit comments