From 5c3c6b9e3e12b28efce9937fde29490f7d5b7a59 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 6 Mar 2023 08:39:07 +0300 Subject: vnext: live-server -> webpack-dev-server --- vnext/webpack.config.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'vnext') diff --git a/vnext/webpack.config.js b/vnext/webpack.config.js index d8b7a076..a4bc0081 100644 --- a/vnext/webpack.config.js +++ b/vnext/webpack.config.js @@ -1,4 +1,5 @@ const ESLintPlugin = require('eslint-webpack-plugin'); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const TerserPlugin = require('terser-webpack-plugin'); module.exports = (env, argv) => { @@ -8,7 +9,7 @@ module.exports = (env, argv) => { mode: node_env, devtool: dev ? 'source-map' : false, entry: { - 'scripts': [ + 'index': [ __dirname + '/src/index.js' ] }, @@ -25,6 +26,19 @@ module.exports = (env, argv) => { /\bwebpack\/buildin\b/ ], loader: 'babel-loader' + }, { + test: /\.(css)$/, + use: [ + { + loader: dev ? 'style-loader' : MiniCssExtractPlugin.loader, + }, + { + loader: 'css-loader', + options: { + sourceMap: true, + }, + } + ], }, { test: /\.(png|jpe?g|gif|svg)$/i, use: [ -- cgit v1.2.3