From 52baf20c85b81ef7c0e1646959a4c2ae0266a9e1 Mon Sep 17 00:00:00 2001 From: zoweb Date: Mon, 29 Oct 2018 21:03:53 +1000 Subject: [PATCH] remove path parts to fix "../" --- packages/core/parcel-bundler/src/assets/KotlinAsset.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/core/parcel-bundler/src/assets/KotlinAsset.js b/packages/core/parcel-bundler/src/assets/KotlinAsset.js index a9c4709fc41..9137c334f07 100644 --- a/packages/core/parcel-bundler/src/assets/KotlinAsset.js +++ b/packages/core/parcel-bundler/src/assets/KotlinAsset.js @@ -15,8 +15,10 @@ class KotlinAsset extends Asset { ); const fs = require('fs', this.name); - // remove extension - let fileName = this.id.substring(0, this.id.lastIndexOf('.')); + // remove extension and path + let slashyIndex = this.id.lastIndexOf('/'); // linux/mac + if (slashyIndex === -1) slashyIndex = this.id.lastIndexOf('\\'); // windows + const fileName = this.id.substring(slashyIndex, this.id.lastIndexOf('.')); await kotlinCompiler.compile({ output: 'build/kt.temp/' + fileName + '.js',