File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,10 @@ class ModuleScopePlugin {
3737 // Maybe an indexOf === 0 would be better?
3838 const relative = path . relative ( appSrc , request . context . issuer ) ;
3939 // If it's not in src/ or a subdirectory, not our request!
40- if ( relative [ 0 ] === '.' ) {
40+ if (
41+ relative . startsWith ( '../' ) ||
42+ relative . startsWith ( '..\\' )
43+ ) {
4144 return callback ( ) ;
4245 }
4346 // Find path from src to the requested file
@@ -49,7 +52,10 @@ class ModuleScopePlugin {
4952 )
5053 ) ;
5154 // Error if in a parent directory of src/
52- if ( requestRelative [ 0 ] === '.' ) {
55+ if (
56+ requestRelative . startsWith ( '../' ) ||
57+ requestRelative . startsWith ( '..\\' )
58+ ) {
5359 callback (
5460 new Error (
5561 `You attempted to import ${ chalk . cyan ( request . __innerRequest_request ) } which falls outside of the project ${ chalk . cyan ( 'src/' ) } directory. ` +
You can’t perform that action at this time.
0 commit comments