diff --git a/package.json b/package.json index cd651e3..d7a7fdd 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/utils/serverRender.js b/src/utils/serverRender.js index afe5ede..2a8640b 100644 --- a/src/utils/serverRender.js +++ b/src/utils/serverRender.js @@ -26,9 +26,11 @@ function renderFullPage(html) { Matúš Námešný - + + +
${process.env.NODE_ENV === 'production' ? html : `
${html}
`}
diff --git a/webpack.prod.config.js b/webpack.prod.config.js index 4b456af..9211799 100644 --- a/webpack.prod.config.js +++ b/webpack.prod.config.js @@ -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({}) ] } diff --git a/yarn.lock b/yarn.lock index 1f5bf68..c1a44d5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"