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

Webpack and RSPack plugins fail when there are files with other extensions #39

Closed
deepjoy opened this issue May 18, 2024 · 2 comments · Fixed by #40
Closed

Webpack and RSPack plugins fail when there are files with other extensions #39

deepjoy opened this issue May 18, 2024 · 2 comments · Fixed by #40

Comments

@deepjoy
Copy link
Contributor

deepjoy commented May 18, 2024

When there are other file types/loaders used, an attempt is made to process them as valid input for stylex leading to a compilation failure
example if the index.html file has a different extension for template compilation.

ERROR in   Error: Child compilation failed:
  Module parse failed: Unexpected token (1:0)
  File was processed with these loaders:
   * ../../node_modules/.pnpm/html-webpack-plugin@5.6.0_webpack@5.91.0/node_modules/html-webpack-plugin/lib/loader.js
   * ../../node_modules/.pnpm/unplugin@1.10.1/node_modules/unplugin/dist/webpack/loaders/transform.js
  You may need an additional loader to handle the result of these loaders.
  > <!DOCTYPE html>
  | <html lang="en">
  | 
deepjoy pushed a commit to deepjoy/unplugin-stylex that referenced this issue May 18, 2024
Also
* places stricter type restriction when using options internally
* removes unused options since default values are not clear
@eryue0220
Copy link
Owner

@deepjoy
Copy link
Contributor Author

deepjoy commented Jul 17, 2024

I've been runnning into this with more and more extensions since bundlers deal with fonts, images, svg, xml, json and numerous other extension. Could we flip to a model that only validExts are processed by this plugin.

Maybe something like
'''
[ ".js", ".cjs", ".mjs", ".ts", ".jsx", ".tsx"]
'''
By default.

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

Successfully merging a pull request may close this issue.

2 participants