sveltejs / svelte-cli

Command line interface for Svelte
MIT License
105 stars 18 forks source link

Compiling directory of components fails #7

Closed jacobmischka closed 7 years ago

jacobmischka commented 7 years ago

Excited to be using svelte! It's a great way to progressively enhance non-SPAs in particular.

Trying to compile a directory of components as noted in the README is failing with EEXIST because the destination directory already exists.

$ svelte compile -i _svelte_components -o _js/components 
fs.js:854
  return binding.mkdir(pathModule._makeLong(path),
                 ^

Error: EEXIST: file already exists, mkdir '_js'
    at Object.fs.mkdirSync (fs.js:854:18)
    at mkdirp (/home/mischka/projects/predict-pain-lab/node_modules/svelte-cli/bin.js:550:5)
    at mkdirp (/home/mischka/projects/predict-pain-lab/node_modules/svelte-cli/bin.js:549:2)
    at compile$1 (/home/mischka/projects/predict-pain-lab/node_modules/svelte-cli/bin.js:573:3)
    at Object.<anonymous> (/home/mischka/projects/predict-pain-lab/node_modules/svelte-cli/bin.js:663:3)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
error Command failed with exit code 1.
$ tree _svelte_components/
_svelte_components/
└── PersonDetails.html

0 directories, 1 file

$ tree _js
_js
├── components
│   └── PersonDetails.js

1 directory, 16 files

Thank you! :hatching_chick: