Skip to content

Commit

Permalink
Fix writing files in subfolders inside dist directory (#1097)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ty3uK authored and devongovett committed Apr 4, 2018
1 parent 9792f48 commit 0e1863b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/packagers/RawPackager.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const Packager = require('./Packager');
const path = require('path');
const fs = require('../utils/fs');

class RawPackager extends Packager {
Expand All @@ -12,6 +13,11 @@ class RawPackager extends Packager {
contents = await fs.readFile(contents ? contents.path : asset.name);
}

// Create sub-directories if needed
if (this.bundle.name.includes(path.sep)) {
await fs.mkdirp(path.dirname(this.bundle.name));
}

this.size = contents.length;
await fs.writeFile(this.bundle.name, contents);
}
Expand Down

0 comments on commit 0e1863b

Please sign in to comment.