Skip to content

Commit

Permalink
remove path parts to fix "../"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoweb committed Oct 29, 2018
1 parent 7acaf3e commit 52baf20
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/core/parcel-bundler/src/assets/KotlinAsset.js
Expand Up @@ -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',
Expand Down

0 comments on commit 52baf20

Please sign in to comment.