0

I'm using Parcel 2. I have set up a folder structure for separate JS and Scss files. I can get Parcel to bundle them and output the files, however, they end up in a subfolder. I want the files to be in the root of the output folder.

Structure:

  • assets (dir)
  • styles (dir)
    • templates
    • sections
    • index.scss
  • scripts (dir)
    • templates
    • sections
    • index.js

I want both index files to make it into the root of the assets folder, but when I run Parcel I end up with this:

  • assets
    • styles
      • index.css
    • scripts
      • index.js

I've tried many different variations of the command, but so far none will drop the files into the root of assets. Any ideas?

This is the current command from my package.json file:

"dev": "parcel styles/index.scss scripts/index.js --dist-dir assets"
bprdev
  • 693
  • 9
  • 12

1 Answers1

1

I figured it out. Replying in case someone else runs into the same thing.

I created a new dir called Parcel and moved everything into it. Then I moved both index files into the root of Parcel. Then I ran npm run dev from the root of the Parcel folder. I was then getting the individual scss and js files outputted to the root of my assets dir.

  • Assets
  • Parcel
    • Styles
      • Global
      • Product
      • Collection
    • Scripts
      • Global
      • Product
      • Collection
    • index.scss
    • index.js

Note: after I got this working I ran into another issue where the js file that got outputted was empty. As of the writing of this post I haven't been able to fix that yet.

bprdev
  • 693
  • 9
  • 12