File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
projects/npm-tools/packages/npm-scripts/src/utils Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -263,13 +263,19 @@ module.exports = async function () {
263263 } ;
264264} ;
265265
266- function transformExposes ( exposes , inputDirectory ) {
266+ function transformExposes ( exposes , inputDir ) {
267267 return exposes . reduce ( ( exposes , filePath ) => {
268- const exposeName = path . posix
269- . relative ( '.' , filePath )
270- . replace ( / \. j s $ / i, '' ) ;
268+ if ( ! filePath . startsWith ( '<inputDir>/' ) ) {
269+ throw new Error (
270+ "Only paths relative to '<inputDir>/' are accepted as 'exposes'"
271+ ) ;
272+ }
271273
272- exposes [ exposeName ] = `./${ inputDirectory } /${ filePath } ` ;
274+ filePath = filePath . replace ( / ^ < i n p u t D i r > \/ / , '' ) ;
275+
276+ const exposeName = filePath . replace ( / \. j s $ / i, '' ) ;
277+
278+ exposes [ exposeName ] = `./${ inputDir } /${ filePath } ` ;
273279
274280 return exposes ;
275281 } , { } ) ;
You can’t perform that action at this time.
0 commit comments