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

In dev mode, bundling issue for required images #82

Description

@jldinh

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}`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions