Skip to content

webpack5 cache create failed #4

@OckhamRazor

Description

@OckhamRazor

Problem:
When I set it up, I get an error.

cache: {
 type: 'filesystem'
}

Error log:

 -> RawSource
    [webpack.cache.PackFileCacheStrategy] Error: No serializer registered for RawSource

Thinking 🤔:
I think it's because a new source has been replaced afterafterCodeGeneration. so can I modify it directly on the original source?

sourceMap.set(
    'javascript',
    new RawSource(rawSource.source().replace(`"${urlTemplate}"`, urlExpression))
);

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