Skip to content

Error with css-loader #148

@wy-z

Description

@wy-z

There will be some error while load(file-loader) font files with relative path.
Config.

{
    test: /\.(ttf|eot|svg|woff(2)?)(\?.*)?$/,
    loader: 'file-loader'
}

Error.

Failed to decode downloaded font: http://localhost:3000/
OTS parsing error: invalid version tag

Info.
webpack/css-loader

SourceMaps

To include SourceMaps set the sourceMap query param.

require("css-loader?sourceMap!./file.css")

I. e. the extract-text-webpack-plugin can handle them.

They are not enabled by default because they expose a runtime overhead and increase in bundle size (JS SourceMap do not). In addition to that relative paths are buggy and you need to use an absolute public path which include the server url.

vue-loader/lib/loader.js

if (this.sourceMap) {
   defaultLoaders.css = 'style-loader!css-loader?sourceMap'
 }

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