Skip to content

Blob links affects the styles later than JS execution #121

@ipy

Description

@ipy

html:

  <style type="text/css">
  .test {
    background: red;
    width: 100px;
    height: 100px;
  }
  </style>
  <div class="test"></div>

css:

.test {
  display: none;
}

js:

require('./test.css');
$('.test').show();

In this case, if css-loader is used with ?sourceMap option, the css will be generated as Blobs. However, it seems that it will take sometime for blob link to load. So $('.test').show(); executes before display: none; takes effect, and nothing shows up.
It's fine to print css directly on the page.

Is there any way to enable source-map without that problem?

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions