Skip to content

module.resource is not available for css files #534

@webpack-bot

Description

@webpack-bot

Bug report

What is the current behavior?

module.resource is undefined

If the current behavior is a bug, please provide the steps to reproduce.

module.exports = {

    optimization: {

        splitChunks: {

            cacheGroups: {

                vendor: {

                    name    : 'vendor',
                    chunks  : 'all',
                    enforce : true,
                    test    : module => { console.log( module.resource ); return false }

                }
            }
        }
    }
}

Using:

  • MiniCssExtractPlugin.loader
  • postcss-loader
  • css-loader
  • sass-loader

What is the expected behavior?
module.resource should be the path of the css file.

Other relevant information:
webpack version: 4.43.0
Node.js version: 12.17.0
Operating System: Running on Docker node


This issue was moved from webpack/webpack#11004 by @evilebottnawi. Original issue was by @AnmSaiful.

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