aurelia / bundler

A library for bundling JavaScript, HTML and CSS for use with SystemJS.
MIT License
37 stars 25 forks source link

Cannot create bundle dir of more than one level #125

Closed RomkeVdMeulen closed 7 years ago

RomkeVdMeulen commented 8 years ago

Rev a8a4f33 fixed #102 but unfortunately this only works if the bundle dir is one level deep. I'm currently working on a project where I'm producing a number of bundles which I want to separate in multiple levels. E.g.:

bundles
 |- lib
    |- aurelia.js
    |- third-party.js
 |- app
    |- module-login.js
    |- module-shoppingcart.js

Currently trying to do this results in:

Error: ENOENT: no such file or directory, mkdir 'myproject/bundles/vendor'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:842:18)
    at writeOutput (myproject/node_modules/aurelia-bundler/dist/bundler.js:186:20)
    at myproject/node_modules/aurelia-bundler/dist/bundler.js:163:5
    at tryCatcher (myproject/node_modules/systemjs-builder/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (myproject/node_modules/systemjs-builder/node_modules/bluebird/js/release/promise.js:502:31)
    at Promise._settlePromise (myproject/node_modules/systemjs-builder/node_modules/bluebird/js/release/promise.js:559:18)
    at Promise._settlePromise0 (myproject/node_modules/systemjs-builder/node_modules/bluebird/js/release/promise.js:604:10)
    at Promise._settlePromises (myproject/node_modules/systemjs-builder/node_modules/bluebird/js/release/promise.js:683:18)
    at Async._drainQueue (myproject/node_modules/systemjs-builder/node_modules/bluebird/js/release/async.js:138:16)
    at Async._drainQueues (myproject/node_modules/systemjs-builder/node_modules/bluebird/js/release/async.js:148:10)
    at Immediate.Async.drainQueues [as _onImmediate] (myproject/node_modules/systemjs-builder/node_modules/bluebird/js/release/async.js:17:14)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

Perhaps the bundler could create every intermediate dir as needed? I'd be happy to work on a PR when I have some time on my hand.

EisenbergEffect commented 8 years ago

@RomkeVdMeulen We'd love a PR for this if you can.

ahmedshuhel commented 7 years ago

This PR should solve this problem. We are using mkdirp now.