sass - How to get webpack to inline css into the generated html file -
i'm trying webpack inline scss generated html file use app-shell css.
the idea webpack bundle scss file ending in '-file.scss' css file , inline scss in files ending '-shell.scss'.
this way app-shell style before react or else loads.
by inline mean put in style tags in generated html file.
the css part of webpack is:
{ test: /\.css$/, include: [paths.appsrc, paths.appnodemodules], // disable autoprefixer in css-loader itself: // https://github.com/webpack/css-loader/issues/281 // have postcss. loader: extracttextplugin.extract('style', 'css?-autoprefixer!postcss') }, { test: /-shell\.scss$/, include: paths.appsrc, loaders: ['style', 'css', 'sass'], }, { test: /-file\.scss$/, include: paths.appsrc, loader: extracttextplugin.extract('style', 'css!sass'), },
i had thought removing extracttextpugin loader "test: /-shell.scss$/" doesn't put styles style tags in generated html build file.
i've adapted create react app setup https://github.com/facebookincubator/create-react-app
Comments
Post a Comment