Question: Is anyone here using webpack 4 and doing HMR with elm ?

Asked By
Asked At
2018-03-22 00:06:16

Found 15 possible answers.

User Answered At Possible Answer
simonh 2018-03-26 06:24:26 yes, it seems to be working fine for me, cut the compile times seem to have increased (just a feeling) I've added the mode param - will see if that helps There is some strangeness though. When I save a css or js file it seems to be re-compiling some of my Elm
rtfeldman 2018-03-28 19:21:36 dunno if anyone is familiar with uglify and webpack, but thought I'd post this potential optimization in case someone more knowledgeable wants to investigate!
antew 2018-03-29 03:38:27 create-elm-app does something similar, but it doesn't have all of them, might be room for some more optimization!
ivanbanov 2018-04-18 08:49:44 There is anyone else with problems of memory leak? My server after some hours is shutting down because of JavaScript heap out of memory :disappointed:
eeue56 2018-04-18 09:34:08 It can happen, webpack is not really well designed in that sense. I recommend making sure you're on the latest version of webpack and the webpack loader
peacememories 2018-04-21 10:18:35 hmm, has anyone worked with elm and webpack and has a solution for resource bundling? this gives me convenience, a small build product as well as usage tracking for my svgs. is there a way to do this when introducing elm? i know i could require the svgs in the js and then pass them as init arguments, but that would mean no usage tracking and manual decisions on which svgs to include in my map with js and webpack it's nice that i can just require an svg and get a react component back (and the svg is added to my spritemap)
eeue56 2018-04-21 10:27:49
peacememories 2018-04-21 10:30:57 thanks or is the call not flattened by the elm-compiler? so e.g. i make a function sprite : String -> Html msg and then call it in my view function with sprite "up-arrow.svg" hmm, the question here is, if i create a function using AssetPath, and then call it with a literal in code, would this still work?
patrick 2018-04-24 00:30:05 Using elm-webpack-loader in watch mode, sometimes my Elm app rebuilds in 3 seconds, other times 118 seconds. I'm using the latest webpack 4.6 and everything else. Has anyone encountered such issues and do you have tips to debug what the loader is actually spending time on?
hpate 2018-04-25 18:14:46 @patrick does it happen when you save certain files? Whenever you save a file it recompiles all files that import that file as well, so files that are imported a lot tend to take longer to compile after a change
patrick 2018-04-25 18:33:28 There's some caching involved, it's fast if I just save any file as-is but if I change any character in Main.elm or any other file that's imported in multiple places, it takes nearly 2 minutes. @patrick Removing Babel completely solves the problem. Sorry Webpack, all good! It's webpack specific though, worst case if I build Elm using CLI is 10 seconds.
james766 2018-04-28 21:03:45 Does anyone have webpack dev server successfully proxying websocket with elm? I'm experimenting with it, but my API doesn't seem to be receiving the request, and I see connection timeouts in JS console. OMG, there was a typo in my IP address. I will go sit in the corner in shame now. "dependencies": { }, } "target": " http://localhost:9000 " "/debug": { }, "logLevel": "debug" "ws": true, "target": " http://localhost:9000 ", "/api": { "proxy": { "exposed-modules": [], ` my elm-package.json has:
dennis.palmer 2018-05-04 17:09:12 I've got webpack-dev-server configured and working with elm-webpack-loader . That works great. What do I need to do to get it to automatically run my elm tests?
eeue56 2018-05-04 19:45:44 Hmm, I would just use the watch option on elm test
joefiorini 2018-05-08 16:05:19 Anyone ever seen this behavior? agh, my cwd was bad… Seems to be related to using the cwd option? So the path it’s trying to spawn exists, and I can execute it manually, but it breaks when run through webpack
like this by deleting elm-stuff/ and rebuilding your project.
Maybe your elm-stuff/ directory has been corrupted? You can usually fix stuff
Could not find package elm-lang/core.
Okay, I did not change anything!
Do you approve of this plan? [Y/n] n
    elm-lang/virtual-dom 2.0.4
    elm-lang/html 2.0.0
    elm-lang/core 5.1.1
Some new packages are needed. Here is the upgrade plan.
⊕ /usr/local/bin/elm-make                                                                   (master)
lrwxr-xr-x  1 jfiorini  admin    81B Apr  2 15:18 /usr/local/bin/elm-make -> ../../../Users/jfiorini
⊗ ll /usr/local/bin/elm-make (master) But: > Could not find Elm compiler “/usr/local/bin/elm-make”. Is it installed? > Running /usr/local/bin/elm-make /src/asurint/asurint-ui-prototype/Shared/Serenity/src/Serenity/Components.elm --yes --output /var/folders/z5/6zxqbv1924x3fr422hymsfj1wmvzpx/T/11848-16194-1b56emc.p4d3.js

Related Questions