diff --git a/package.json b/package.json index eb916c9a7..c99755fd5 100755 --- a/package.json +++ b/package.json @@ -44,9 +44,9 @@ "html-webpack-plugin": "3.2.0", "less": "3.9.0", "less-loader": "5.0.0", + "mini-css-extract-plugin": "0.8.0", "postcss-loader": "3.0.0", "storybook-addon-jsx": "7.1.5", - "style-loader": "0.23.1", "terser-webpack-plugin": "1.3.0", "webpack": "4.36.1", "webpack-cli": "3.3.6", diff --git a/src/index.html b/src/index.html index 041bdb3d5..debea7d9f 100755 --- a/src/index.html +++ b/src/index.html @@ -5,6 +5,9 @@ Stremio - All you can watch! + diff --git a/webpack.config.js b/webpack.config.js index 7c5596ce8..1be829343 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,7 @@ const path = require('path'); const webpack = require('webpack'); const HtmlWebPackPlugin = require('html-webpack-plugin'); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const { CleanWebpackPlugin } = require('clean-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin'); @@ -34,14 +35,17 @@ module.exports = { exclude: /node_modules/, use: [ { - loader: 'style-loader' + loader: MiniCssExtractPlugin.loader, + options: { + reloadAll: true + }, }, { loader: 'css-loader', options: { importLoaders: 2, modules: { - localIdentName: '[local]_[hash:base64:5]', + localIdentName: '[local]_[hash:base64:5]' } } }, @@ -138,10 +142,13 @@ module.exports = { template: './src/index.html', inject: false }), + new MiniCssExtractPlugin({ + filename: 'styles.css', + }), new CleanWebpackPlugin({ verbose: true, cleanOnceBeforeBuildPatterns: [], - cleanAfterEveryBuildPatterns: ['./bundle.js'] + cleanAfterEveryBuildPatterns: ['./bundle.js', './styles.css'] }) ] }; diff --git a/yarn.lock b/yarn.lock index 555ff1b9f..867fe589e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6117,6 +6117,16 @@ min-document@^2.19.0: dependencies: dom-walk "^0.1.0" +mini-css-extract-plugin@0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.8.0.tgz#81d41ec4fe58c713a96ad7c723cdb2d0bd4d70e1" + integrity sha512-MNpRGbNA52q6U92i0qbVpQNsgk7LExy41MdAlG84FeytfDOtRIf/mCHdEgG8rpTKOaNKiqUnZdlptF469hxqOw== + dependencies: + loader-utils "^1.1.0" + normalize-url "1.9.1" + schema-utils "^1.0.0" + webpack-sources "^1.1.0" + mini-css-extract-plugin@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.7.0.tgz#5ba8290fbb4179a43dd27cca444ba150bee743a0" @@ -8773,7 +8783,7 @@ strip-json-comments@~2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= -style-loader@0.23.1, style-loader@^0.23.1: +style-loader@^0.23.1: version "0.23.1" resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.23.1.tgz#cb9154606f3e771ab6c4ab637026a1049174d925" integrity sha512-XK+uv9kWwhZMZ1y7mysB+zoihsEj4wneFWAS5qoiLwzW0WzSqMrrsIy+a3zkQJq0ipFtBpX5W3MqyRIBF/WFGg==