Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

font path with ?# param results in [object Module] #469

Closed
abhijithbabu opened this issue Nov 29, 2019 · 4 comments
Closed

font path with ?# param results in [object Module] #469

abhijithbabu opened this issue Nov 29, 2019 · 4 comments

Comments

@abhijithbabu
Copy link

abhijithbabu commented Nov 29, 2019

  • Operating System: OSX
  • Node Version: 10.16.3
  • NPM Version: Yarn
  • webpack Version: 4.41.2
  • mini-css-extract-plugin Version: 0.8.0

Expected Behavior

Expected behaviour is to have correct file name.
Example url("fonts/Graphik-Regular.eot?#iefix") format("embedded-opentype")

Actual Behavior

Currently it outputs changes path and name to [object Module]
Example: src: url("[object Module]?#iefix") format("embedded-opentype")

Code

Webpack config related part

, {
            test: /\.(png|woff|woff2|eot|otf|ttf|svg)$/,
            use: [
                {
                    loader: 'url-loader',
                    options: {
                        limit: 1000,
                        name: '[name].[ext]',
                        outputPath: 'fonts/'
                    }
                }
            ]
        }, {
            test: /\.scss$/,
            use: [{
                loader: MiniCssExtractPlugin.loader
            },
                {
                    loader: "css-loader",
                    options: {
                        sourceMap: true
                    }
                },
                "sass-loader"
            ]
        }

SCSS sample

@font-face {
    font-family: $graphik-regular;
    src: url('../fonts/Graphik-Regular.eot');
    src: url('../fonts/Graphik-Regular.eot?#iefix') format('embedded-opentype'),
        url('../fonts/Graphik-Regular.woff2') format('woff2'),
        url('../fonts/Graphik-Regular.woff') format('woff'),
        url('../fonts/Graphik-Regular.ttf') format('truetype'),
        url('../fonts/Graphik-Regular.svg#Graphik-Regular') format('svg');
    font-style: normal;
}

How Do We Reproduce?

You can have a scss with sample below

@font-face {
    font-family: $graphik-regular;
    src: url('../fonts/Graphik-Regular.eot');
    src: url('../fonts/Graphik-Regular.eot?#iefix') format('embedded-opentype'),
        url('../fonts/Graphik-Regular.woff2') format('woff2'),
        url('../fonts/Graphik-Regular.woff') format('woff'),
        url('../fonts/Graphik-Regular.ttf') format('truetype'),
        url('../fonts/Graphik-Regular.svg#Graphik-Regular') format('svg');
    font-style: normal;
}
@alexander-akait
Copy link
Member

Please create reproducible test repo

@abhijithbabu
Copy link
Author

Hi

Please find it here https://github.com/abhijithbabu/testrepo

Thanks

@alexander-akait
Copy link
Member

Thanks for issue, problem in css-loader, WIP

@alexander-akait
Copy link
Member

Fixed webpack-contrib/css-loader#1001 release will be soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants