Skip to content

webpack dev server breaks if not bundling with multiple rules #139

@shmish111

Description

@shmish111

I am trying to build a project with a web-worker so I have 2 rules that both use purs-loader. If I set bundle: true then I can run a dev server and it seems to work correctly. Unfortunately due to #94 I have to save Main.purs every time I make a change as well as things being very slow, I think because of the bundling. If I set bundle: false (which is what I had in dev-server mode before I started playing with web workers) then I get the following types of errors:

Module build failed (from ./node_modules/purs-loader/lib/index.js):
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object

I've managed to track it down to https://github.com/ethul/purs-loader/blob/3.7.1/src/index.js#L230 where psModuleName is sometimes null because it gets to this line when source is actually a javascript file, (it is a compiled purescript file in fact).

To be honest I have no idea how any of this works so this is as far as I managed to get.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions