File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -42,14 +42,22 @@ pub fn process_transform(program: Program, _metadata: TransformPluginProgramMeta
4242 let cwd = & raw_cwd. replace ( '\\' , "/" ) ;
4343 let path = & raw_path. replace ( '\\' , "/" ) ;
4444
45- if let Some ( relative_path) = path. strip_prefix ( cwd) {
45+ // overlapping prefix
46+ let prefix = cwd
47+ . chars ( )
48+ . zip ( path. chars ( ) )
49+ . take_while ( |( a, b) | a == b)
50+ . map ( |( a, _) | a)
51+ . collect :: < String > ( ) ;
52+
53+ if let Some ( relative_path) = path. strip_prefix ( & prefix) {
4654 let mut is_page = false ;
4755
4856 for component in Path :: new ( relative_path) . components ( ) {
4957 match component {
5058 Component :: Normal ( str) => match str. to_str ( ) . unwrap_or_default ( ) {
5159 // skip non-source stuff
52- "node_modules" | "dist" => {
60+ "node_modules" => {
5361 return program;
5462 }
5563 "pages" => {
You can’t perform that action at this time.
0 commit comments