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

Require without file extension #397

Closed
Corwynt opened this issue Dec 17, 2018 · 2 comments · Fixed by #541
Closed

Require without file extension #397

Corwynt opened this issue Dec 17, 2018 · 2 comments · Fixed by #541
Assignees
Labels
bug Something isn't working

Comments

@Corwynt
Copy link

Corwynt commented Dec 17, 2018

Description
In one of the latest releases, using require on a local file does not work anymore if the file extension is omitted. I need this functionality to allow the inclusion of jsx files. These files have the jsx extension in the source directory, but are renamed to js files inside the .hlx/build directory and can therefore not be required anymore.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new demo project hlx demo test
  2. add a new js file src/test.js with content module.exports = "Test";
  3. add const test = require("./test"); at the beginning of src/html.pre.js
  4. run helix with hlx up

Expected behavior
Helix should build the project without complains.

Version:
0.10.10

@tripodsan
Copy link
Contributor

how are you using the jsx files? i.e. do you have a parcel plugin that transforms them into pipeline function? if they are clientside files, don't put them im src but build/copy them into /dist (or whatever your webroot is).

but I agree, that it should work w/o extension.

@trieloff trieloff added the bug Something isn't working label Dec 18, 2018
@tripodsan tripodsan self-assigned this Feb 14, 2019
tripodsan added a commit that referenced this issue Feb 14, 2019
tripodsan added a commit that referenced this issue Feb 14, 2019
@tripodsan
Copy link
Contributor

this now works with hlx up, but not with hlx package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants