Extract css

This commit is contained in:
LordMathis 2018-06-21 11:06:58 +02:00
parent 1bd025f411
commit f5f008e5a4
4 changed files with 14 additions and 2 deletions

View File

@ -43,6 +43,7 @@
"css-loader": "^0.28.11",
"css-modules-require-hook": "^4.0.6",
"file-loader": "^1.1.11",
"mini-css-extract-plugin": "^0.4.0",
"postcss-loader": "^2.1.4",
"sass-loader": "^7.0.1",
"style-loader": "^0.21.0",

View File

@ -26,9 +26,11 @@ function renderFullPage(html) {
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Matúš Námešný</title>
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans|Open+Sans+Condensed:700&amp;subset=latin-ext" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open+Sans|Open+Sans+Condensed:700&amp;subset=latin-ext" rel="stylesheet">
<!-- Font Awesome -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<!-- Stylesheet -->
<link href="/static/bundle.css" rel="stylesheet">
</head>
<body>
<div id="root">${process.env.NODE_ENV === 'production' ? html : `<div>${html}</div>`}</div>

View File

@ -1,5 +1,6 @@
const { resolve, join } = require('path')
const webpack = require('webpack')
const MiniCssExtractPlugin = require("mini-css-extract-plugin")
const config = {
mode: 'production',
@ -26,7 +27,7 @@ const config = {
{
test: /\.scss$/,
use: [
'style-loader',
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: {
@ -51,6 +52,7 @@ const config = {
]
},
plugins: [
new MiniCssExtractPlugin({})
]
}

View File

@ -4063,6 +4063,13 @@ min-document@^2.19.0:
dependencies:
dom-walk "^0.1.0"
mini-css-extract-plugin@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.4.0.tgz#ff3bf08bee96e618e177c16ca6131bfecef707f9"
dependencies:
loader-utils "^1.1.0"
webpack-sources "^1.1.0"
minimalistic-assert@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7"