Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty Javascript File When Building #7412

Closed
preston-mro opened this issue Dec 7, 2021 · 3 comments
Closed

Empty Javascript File When Building #7412

preston-mro opened this issue Dec 7, 2021 · 3 comments

Comments

@preston-mro
Copy link

🐛 bug report

In my package.json:

"dev": "parcel parcel/index.scss parcel/index.js --dist-dir assets --no-source-maps",
"build": "parcel build parcel/index.scss parcel/index.js --dist-dir assets --no-source-maps"

dev works. I get the expected results, which is my two index files are dropped into the root of my assets folder and both are populated with code. I can see my Sass and JS coming in from the separate files.
build will also output both index files, however, the js file is empty. The css file is populated.

No errors. Build completes.

All other settings are default.

Let me know if you need any more info. Thanks for any help.

🤔 Expected Behavior

index.js has code in it.

😯 Current Behavior

index.js is empty.

How has this issue affected you? What are you trying to accomplish?

I am a Shopify developer and I want to set up a build tool for JS and Sass.

🌍 Your Environment

I'm on a Win10 laptop running the latest node and npm.

@astegmaier
Copy link
Contributor

astegmaier commented Dec 9, 2021

This issue was also posted on stackoverflow, and I managed to resolve it there. Feel free to close.

The problem was that the entire bundle was getting tree-shaken away - because it was intended to expose the contents as a global variables - which were not used in the bundle itself. We managed to find a workaround, but this process will become simpler once #7312 is fixed.

@mischnic
Copy link
Member

mischnic commented Dec 9, 2021

@astegmaier Thanks!

@mischnic mischnic closed this as completed Dec 9, 2021
@preston-mro
Copy link
Author

you beat me to it by ten minutes, Andrew! Haa. I just came here to make the same update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants