Skip to content
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.

In dev mode, bundling issue for required images #82

Open
jldinh opened this issue Feb 17, 2020 · 0 comments
Open

In dev mode, bundling issue for required images #82

jldinh opened this issue Feb 17, 2020 · 0 comments

Comments

@jldinh
Copy link

jldinh commented Feb 17, 2020

In dev mode, using image files with require leads to 404 errors.

From what I can see, the webpack-dev-server serves them from port 3010 (by default) but the client app tries to fetch them from port 3000 (the startupjs server).

It might be because webpack does not seem to emit files to the build folder assumed in

.use('/build/client', express.static(options.dirname + '/build/client', { maxAge: '1h' }))
when in dev mode.

It can be fixed at https://github.com/dmapper/startupjs/blob/master/packages/bundler/webpack.web.config.js#L157 by replacing that line with

publicPath: PROD ? BUILD_DIR : `http://localhost:${DEV_PORT}${BUILD_DIR}`
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant