Skip to content

Commit

Permalink
Merge pull request #12 from shrynx/feature/dynamic_dirs
Browse files Browse the repository at this point in the history
dynamically create directories as per file path
  • Loading branch information
btd committed Mar 26, 2018
2 parents ef37894 + 9aed2ee commit ab530a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"prepare": "npm run build"
},
"dependencies": {
"mkdirp": "^0.5.1",
"source-map": "^0.7.2"
},
"devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions plugin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const fs = require("fs");
const path = require("path");
const mkdirp = require('mkdirp');
const SourceMapConsumer = require("source-map").SourceMapConsumer;

const cssString = fs.readFileSync(path.join(__dirname, "lib", "./style.css"), "utf8");
Expand Down Expand Up @@ -65,6 +66,7 @@ module.exports = function(opts) {
${jsString}
</script>
`;
mkdirp.sync(path.dirname(filename));
fs.writeFileSync(filename, html);
}
};
Expand Down

0 comments on commit ab530a9

Please sign in to comment.