This repository was archived by the owner on Oct 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,14 @@ const loaderUtils = require('loader-utils');
66module . exports = function ( indexContent ) {
77 let options = { } ;
88 let baseDirectory ;
9+ let loaderPath = 'node_modules' + path . sep + '@kirschbaum-development' + path . sep + 'laravel-translations-loader' + path . sep + 'all.js' ;
910
1011 try {
1112 options = loaderUtils . parseQuery ( this . query ) ;
1213 } catch ( e ) { }
1314
14- if ( path . dirname ( this . resource ) . includes ( path . dirname ( 'node_modules/@kirschbaum-development/laravel-translations-loader/all.js' ) ) ) {
15- baseDirectory = path . dirname ( this . resource ) + "/../../../ resources/ lang" ;
15+ if ( path . dirname ( this . resource ) . includes ( loaderPath ) ) {
16+ baseDirectory = path . dirname ( this . resource ) + path . sep + '..' + path . sep + '..' + path . sep + '..' + path . sep + ' resources' + path . sep + ' lang' ;
1617 } else {
1718 baseDirectory = path . dirname ( this . resource ) ;
1819 }
Original file line number Diff line number Diff line change @@ -6,13 +6,14 @@ const jsonLoader = require('./json-loader');
66module . exports = function ( indexContent ) {
77 let options = { } ;
88 let baseDirectory ;
9+ let loaderPath = 'node_modules' + path . sep + '@kirschbaum-development' + path . sep + 'laravel-translations-loader' + path . sep + 'json.js' ;
910
1011 try {
1112 options = loaderUtils . parseQuery ( this . query ) ;
1213 } catch ( e ) { }
1314
14- if ( path . dirname ( this . resource ) . includes ( path . dirname ( 'node_modules/@kirschbaum-development/laravel-translations-loader/json.js' ) ) ) {
15- baseDirectory = path . dirname ( this . resource ) + "/../../../ resources/ lang" ;
15+ if ( path . dirname ( this . resource ) . includes ( loaderPath ) ) {
16+ baseDirectory = path . dirname ( this . resource ) + path . sep + '..' + path . sep + '..' + path . sep + '..' + path . sep + ' resources' + path . sep + ' lang' ;
1617 } else {
1718 baseDirectory = path . dirname ( this . resource ) ;
1819 }
Original file line number Diff line number Diff line change @@ -7,13 +7,14 @@ const loaderUtils = require('loader-utils');
77module . exports = function ( indexContent ) {
88 let options = { } ;
99 let baseDirectory ;
10+ let loaderPath = 'node_modules' + path . sep + '@kirschbaum-development' + path . sep + 'laravel-translations-loader' + path . sep + 'php.js' ;
1011
1112 try {
1213 options = loaderUtils . parseQuery ( this . query ) ;
1314 } catch ( e ) { }
1415
15- if ( path . dirname ( this . resource ) . includes ( path . dirname ( 'node_modules/@kirschbaum-development/laravel-translations-loader/php.js' ) ) ) {
16- baseDirectory = path . dirname ( this . resource ) + "/../../../ resources/ lang" ;
16+ if ( path . dirname ( this . resource ) . includes ( path . dirname ( loaderPath ) ) ) {
17+ baseDirectory = path . dirname ( this . resource ) + path . sep + '..' + path . sep + '..' + path . sep + '..' + path . sep + ' resources' + path . sep + ' lang' ;
1718 } else {
1819 baseDirectory = path . dirname ( this . resource ) ;
1920 }
You can’t perform that action at this time.
0 commit comments