I am following the basic tutorial for Parcel to bundle js, css and image files.
My file structure
dist
node_modules
src
- index.html
- style.css
- index.js
- somemodule.js
When I run parcel ./src/index.html a server is started and the website is displayed correctly. According to the tutorial you can finalize the build using parcel build index.js. I expected to get this output:
dist
- style.css
- index.js
- index.html
But instead, after running parcel build index.js I get this output:
dist
- 4wyd98y98790.css
- 948y59hslas8.js
What could possibly be going wrong?
The Parcel Bundler output directory is dist by default, but you can specify an output directory by setting option (-d).
e.g.parcel build src/index.html -d build --public-url . You will get the final static files in the build directory.
The tutorial may say parcel build index.js, but you should run parcel build ./src/index.html. The entry point of your app is index.html.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With