node.js - style-loader on webpack in production -


i new node.js application webpack. during development run webpack-dev-server serve bundles , create style tags , put of css on there. how css placed in style tags on production server since can't run webpack-dev-server?

the style-loader not depend on webpack-dev-server, adds css bundle such inject <style> tag <head>, hence name. long you're still using style-loader production build, work same.

because depending on javascript bundle loaded before css getting injected has drawbacks, there exists extract-text-webpack-plugin, extracts css bundle, giving css file can add html, can request/serve css separately javascript bundle.


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -