File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,10 @@ class ModuleScopePlugin {
37
37
// Maybe an indexOf === 0 would be better?
38
38
const relative = path . relative ( appSrc , request . context . issuer ) ;
39
39
// 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
+ ) {
41
44
return callback ( ) ;
42
45
}
43
46
// Find path from src to the requested file
@@ -49,7 +52,10 @@ class ModuleScopePlugin {
49
52
)
50
53
) ;
51
54
// Error if in a parent directory of src/
52
- if ( requestRelative [ 0 ] === '.' ) {
55
+ if (
56
+ requestRelative . startsWith ( '../' ) ||
57
+ requestRelative . startsWith ( '..\\' )
58
+ ) {
53
59
callback (
54
60
new Error (
55
61
`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