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
Post a Comment