C
C
coderlex2016-04-14 10:05:51
webpack
coderlex, 2016-04-14 10:05:51

When is loader executed in webpack?

What does this instruction do
require("style!raw!./file.css");
?
I have 2 options:
1) During the execution of the client code, file.css is loaded from the server, then a chain of loaders is executed. Those. in this option, not the resulting data is inserted into the client script, but the code of the loaders.
2) At compile time, the content of the file.css file is inserted into the chunk and wrapped in a script that creates a style tag with this data inside. Those. style codes are in JS bundles and nothing is loaded from the server during the execution of the client code.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Q
qtuz, 2016-10-31
@qtuz

The second option is correct.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question