-
Notifications
You must be signed in to change notification settings - Fork 107
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
Is it possible to keep non-Elm source vs Elm source in different directories? #26
Comments
Yes. I've modified my project structure like so:
First you need to modify the source directories in your elm-package.json to point to the correct location:
Then update the configurations in |
Looks good @joshuata. I went with a minimal structure for starters, but I may follow your org in a future release. Thanks! |
I borrowed the Webpack config heavily from your work on this project when building a Yeoman generator for Elm (danneu/generator-elm).
elm-webpack-starter's
src/
folder contains not just Elm source, but also all of the static entry-points and static files, likeindex.html
,index.js
, css, and images. elm-webpack-loader does the same in its example project.In my Yeoman generator, I wanted the
src/
folder to contain only Elm source files. Instead, I created a new top-level folderstatic/
and moved index.html/index.js/css/images there. I changed webpack-dev-server's--content-base
fromsrc/
tostatic/
.However, I noticed that webpack-dev-server only picks up changes to the
src/Main.elm
file which is required from mystatic/index.js
entry-point (source).I'm guessing that the rest of my files in
src/
aren't being watched because--content-base static/
only watches that folder tree even thoughstatic/index.js
requiressrc/Main.elm
which imports other Elm files from thesrc/
folder?Is that why you mixed Elm and non-Elm source in
src/
to begin with, so--content-base
will pick up all changes?I think the
src/
andstatic/
separation would be a good improvement for this project, but I couldn't figure out the webpack config incantation to make it work.The text was updated successfully, but these errors were encountered: