From: Dmitry Shachnev Date: Fri, 24 Jan 2025 23:29:10 +0300 Subject: Build only JS with webpack, not CSS Building CSS requires dart-sass, which is not packaged yet (see https://bugs.debian.org/998024). Forwarded: not-needed --- .../assets/scripts/pydata-sphinx-theme.js | 2 -- webpack.config.js | 32 +--------------------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js b/src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js index a861cfd..4b229b7 100644 --- a/src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js +++ b/src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js @@ -2,8 +2,6 @@ import { documentReady } from "./mixin"; import { compare, validate } from "compare-versions"; -import "../styles/pydata-sphinx-theme.scss"; - /******************************************************************************* * Theme interaction */ diff --git a/webpack.config.js b/webpack.config.js index 7040530..711e9e2 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -11,8 +11,6 @@ const { resolve } = require("path"); const HtmlWebpackPlugin = require("html-webpack-plugin"); -const MiniCssExtractPlugin = require("mini-css-extract-plugin"); -const CssMinimizerPlugin = require("css-minimizer-webpack-plugin"); const TerserPlugin = require("terser-webpack-plugin"); const dedent = require("dedent"); const { Compilation } = require("webpack"); @@ -121,7 +119,6 @@ var config = { optimization: { minimizer: [ '...', - new CssMinimizerPlugin(), new TerserPlugin({ terserOptions: { parallel: true, @@ -130,30 +127,6 @@ var config = { }, module: { rules: [{ - test: /\.(sa|sc|c)ss$/, - use: [ - // Extracts CSS for each JS file that includes CSS - { loader: MiniCssExtractPlugin.loader }, - { - // Interprets `@import` and `url()` like `import/require()` and will resolve them - loader: 'css-loader', - options: { - sourceMap: true, - url: true, - } - }, - { loader: 'resolve-url-loader' }, - { - // Loads a SASS/SCSS file and compiles it to CSS - loader: "sass-loader", - options: { - sourceMap: true, - sassOptions: { outputStyle: "expanded" } - } - }, - ], - }, - { // Font vendoring and management - will separate FA and export the font files test: /\.(woff|woff2|eot|ttf|otf)$/i, type: 'asset/resource', @@ -164,10 +137,7 @@ var config = { }, plugins: [ htmlWebpackPlugin, - new MiniCssExtractPlugin({ - filename: "styles/[name].css", - chunkFilename: "styles/[id].css", - })], + ], experiments: { topLevelAwait: true, },