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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -