`preact build` not respecting `preact.config.js` webpack entrypoint?
See original GitHub issueDo you want to request a feature or report a bug? Bug
What is the current behavior?
Hey fam! I’m using the preact-cli-plugin-typescript
plugin, and also changing the entrypoint to index.tsx
instead of index.js
. The npm start
dev build WORKS, but the npm run build
and preact build
breaks with error:
multi ./src/index.js
Module not found: Error: Can't resolve '/Users/ben/Code/Web/fridaypoetry.org/src/index.js' in '/Users/ben/Code/Web/fridaypoetry.org/src'
@ multi ./src/index.js
Build failed!
I’ve also tried various things like preact build --config=preact.config.js --src=src/index.tsx
, but it seems very intent on running from an index.js…
Can't resolve '/Users/ben/Code/Web/fridaypoetry.org/src/index.tsx/index.js'
EDIT:
Not sure if it’s related, but preact watch
works, while preact watch --prerender
fails with error:
https://gist.github.com/ivebencrazy/bccdc25583e1147bb44a922278007c9c
Template execution failed: Error: Cannot find module '/Users/ben/Code/Web/fridaypoetry.org/build/ssr-build/ssr-bundle.js'
Error: Cannot find module '/Users/ben/Code/Web/fridaypoetry.org/build/ssr-build/ssr-bundle.js'
If the current behavior is a bug, please provide the steps to reproduce. Configuration Link: https://github.com/ivebencrazy/fridaypoetry.org/blob/preact-cli/preact.config.js
You won’t be able to run this project in its current state unless you npm link
to:
https://github.com/Blanket-Warriors/Zuck/tree/zuck-ui.
But I can make a branch that doesn’t depend on that if it would help.
What is the expected behavior? I’d expect it to complete the build, since the dev build works.
Please mention other relevant information.
- Node: v7.10.0
- npm: v4.2.0
- preact-cli: v1.4.1
- macOS Sierra: v10.12.6
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
This works. Thanks @variable-content. Altho it’s slightly disappointing that this basically just means that changing the entrypoint is not supported, @lukeed? But that’s just me being picky haha. Thank you both for the help in getting my project working! 🎉
Take a look at this issue on the plugin’s repo: https://github.com/wub/preact-cli-plugin-typescript/issues/3
There’s suggestions from myself and @fend25 which should help get you started.