Hey this is pretty nice!! Feels like a built in feature! I wouldn’t be surprised if MDG forks this
I don’t have a chance to drop in my current project to see if I can find any limitations but as long is there is somewhere to opt into complexity when needed.
In general i’m a big fan of simple by default, opt into complexity
You are one step away from making this work. I will add a note on the readme but here is what you need to do.
If you are under Windows, the node_modules symbolic link on the root folder will not work. To make that work, you need to remove it and create a Windows symbolic link. Here is the command:
@benoitt how did you get it to run the Webpack compiler on Meteor startup if the webpack.conf.js file was already “built”? When I tried to make a similar plugin, isobuild wouldn’t run my build plugin on the file if it hadn’t changed since last time it ran the build plugin (it assumes using the previous output of the plugin is the right thing to do), so it would never end up starting the webpack --watch or webpack-dev-server until I edited the file.
Looks like css file handling by Meteor can’t be prevented completely - The sample apps of this project use *.import.css ending for css. So I think es6 style import of *.import.css files should be possible.
Idk what I’m doing wrong, but hmr is not working nor meteor’s default reloader but the message Client modified -- refreshing appears on console.
What I also noticed is that webpack default message is being supressed?
=> Started your app.
=> App running at: http://localhost:3000/
webpack building...
webpack built b1d81b645d9317c30e22 in 696ms
=> Client modified -- refreshing
Those messages are normal. The client modified – refreshing is blocked because you have HMR. It means it doesn’t need to browser to reload the page. Go look at your browser console. You will see what’s going on and if your config is correct, you will see your page updated.
What you see are simple, fast, readable sourcemaps generated by the cheap-eval-source-map devtool. Unfortunately line numbers are wrong and you see the transpiled JS instead of the original code.
I’ll do a pull request to get better sourcemaps by default.
This is great. I think MDG is moving in the direction to adopt Webpack. The sooner we can have the most amount of weight behind this the better, and if MDG can jump on board on getting this as the official system then the better off we’ll be as a community.
Though it would be even cooler if we could remove the packages.json and keep all of that inside the required packages. So that it looks more like a clean meteor project.