Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I specify the output folder for assets?

Tags:

parceljs

I have a project with this structure:

src
 |- index.pug
 | - layout
 |     |- index.less
 | - scripts
 |     |- index.js

For now, when I run parcel build src/index.pug, all the files are bundled and I've got this on the distribution folder:

dist
  |- index.html
  |- index.12345.css
  |- index.12345.js

When I was spected something like:

dist
  |- index.html
  |- layout
  |    |- index.12345.css
  |- scripts
  |    |- index.12345.js

So, my question is: Can I specify the output path for my css, js and images using ParcelJS?

like image 960
Renan Gomes Avatar asked Aug 02 '18 16:08

Renan Gomes


2 Answers

Parcel doesn't support this feature out of the box, but I've developed a plugin for it. Check it out https://www.npmjs.com/package/parcel-plugin-custom-dist-structure

It is suitable for all types of web/node development projects, it will generate the dist structure you specify while also handle your imports.

Let me know what you think!

like image 139
Vladimir Mikulic Avatar answered Sep 27 '22 20:09

Vladimir Mikulic


With version 1 it's not supported. This is supposed to be available in version 2 through user plugins. See https://github.com/parcel-bundler/parcel/issues/233

like image 25
tcurdt Avatar answered Sep 27 '22 20:09

tcurdt