V
V
Vasily Vasilyev2018-06-25 12:24:56
webpack
Vasily Vasilyev, 2018-06-25 12:24:56

webpack. How to make stylesheets compiled BEFORE html files?

Yes:
I use the postcss-modules plugin, which adds a hash to the names of css classes in the style file and exports them to a separate json table. Next, pug takes this table - and according to it, substitutes the necessary classes into the html page.
Issue: pug compiles before style files, causing " Can't resolve json" errors.
Question: is it possible to arrange the compilation queue in the build? So that style files are processed first, and then html ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anubis, 2018-06-27
@Anubis

You can use HtmlWebpackPlugin, which can automatically embed links to all Webpack-generated assets into the output html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question