Parcel build breaks when trying to build all Sass/JS but not if I specify file names? What am I missing? #9062
Replies: 2 comments
-
Ok so I've given up on using "globs" for my build script and instead doing this the long and messy way. The only thing that I want is to set the src Sass and the src JS files to compile into two separate directories within the
I haven't even included JS files yet and so far, all Sass files are saving as CSS files in |
Beta Was this translation helpful? Give feedback.
-
Closing this so I can create a specific discussion about multiple folders in the dist folder. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to convert a WordPress project of mine to use Parcel to compile JS and Sass files instead of Grunt/Webpack. I think I keep finding documentation for the older parcel (Version 1 instead of 2) and I'm doing something that's breaking when I try to build. I have a package.json file and a .parcelrc file. I have a src folder that looks like this:
-- sass
-- js
And I want files to save the same way in the dist folder. I was code splitting before with Webpack/Grunt where I was able to compile several stylesheets that imported others so that I can enqueue them where needed. For example, I had a stylesheet for the homepage and another for a contact us page etc., and though they both live in the src/sass folder, several css files are compiled from there by site section. I'm trying to re-create this in parcel but when I run
npm run build
I get:But if I try and build a specific set by specifying the file name, it works? What am I doing wrong? Here are the scripts in package.json. I did not add a "main" field/file since I don't need it.
And what I have in .parcelrc (shortened for example):
So
style-archives/style-bookstore
will work but notbuild-styles
, why?Beta Was this translation helpful? Give feedback.
All reactions