replaces http-server with a live-reloading rollup dev server#39
replaces http-server with a live-reloading rollup dev server#39telamonian wants to merge 2 commits intofinos:masterfrom
http-server with a live-reloading rollup dev server#39Conversation
|
The only thing I haven't figured out is how to incorporate the .less sources into the watch build:
|
ec57694 to
4710558
Compare
|
I figured out how to incorporate the .less files into rollup. It appears that rollup can't "just"
|
63f9a5c to
2f8a97f
Compare
2f8a97f to
8994c7f
Compare
|
@texodus As requested, this PR now completely removes I ran into an issue on the CI (which annoyingly didn't show up locally) where jest was trying to run tests before the rollup dev server had finished its build/start-up cycle. I was able to resolve this by having jest wait on the resources in |
http-server with a live-reloading rollup dev server
texodus
left a comment
There was a problem hiding this comment.
Thanks for the PR!
I have played around with this branch and it's a nice QoL improvement for development - except rollup-plugin-serve is just worse than http-server. However, this change is not necessary to support live-reload, so let's just remove this part.
I've actually already done this on #50, as well as rebasing and fixing the other review comments below, so I'll close this PR in lieu of that.
|
|
||
| # test production build | ||
| - yarn build | ||
| - yarn clean |
There was a problem hiding this comment.
Really not fortunate that this builds twice ..
| extract: "material.css", | ||
| sourceMap: false, | ||
| minimize: true, | ||
| }), |
There was a problem hiding this comment.
postcss is a good addition! It was not possible with the old babel-based build but is quite simple with rollup
| import serve from "rollup-plugin-serve" | ||
| import sourcemaps from "rollup-plugin-sourcemaps"; | ||
|
|
||
| export default commandLineArgs => { |
There was a problem hiding this comment.
This file is 99% identical to rollup.config.js - it would be really helpful to not duplicate this as the project grows. Since this version is only called with --watch - why not merge these and simply dispatch the minimize and plugins changes based on this flag as you do --port
| serve({ | ||
| contentBase: [".", "examples"], | ||
| port | ||
| }), |
There was a problem hiding this comment.
There is no nice way to say this - rollup-plugin-server is unconditionally worse than http-server :(
| import {DEBUG, BROWSER_MAX_HEIGHT, DOUBLE_BUFFER_RECREATE, DOUBLE_BUFFER_ROW, DOUBLE_BUFFER_COLUMN} from "./constants"; | ||
|
|
||
| import container_css from "../less/container.less"; | ||
|
|
There was a problem hiding this comment.
This is great to remove but it leaves the vestigial code - the babel plugin and symbol in utils.js
|
Picked up in #50 |
This PR:
buildandwatchcmds in package.jsonhttp-serverwith a dev server that runs as part of a rollup buildsrc/(including the .less files)