feat: expose plugins and presets on SwaggerUI global symbol (#9189)
Part of this commit is also: - complete plugins consolidation - complete presets consolidation - build system consolidation Refs #9188
This commit is contained in:
83
webpack/stylesheets.js
Normal file
83
webpack/stylesheets.js
Normal file
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
|
||||
// NOTE: this config *does not* inherit from `_config-builder`.
|
||||
// It is also used in the dev config.
|
||||
|
||||
const path = require("path")
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin")
|
||||
|
||||
module.exports = {
|
||||
mode: "production",
|
||||
|
||||
entry: {
|
||||
"swagger-ui": "./src/style/main.scss",
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: [/\.(scss)(\?.*)?$/],
|
||||
use: [
|
||||
{
|
||||
loader: MiniCssExtractPlugin.loader,
|
||||
},
|
||||
{
|
||||
loader: "css-loader",
|
||||
options: { sourceMap: true },
|
||||
},
|
||||
{
|
||||
loader: "postcss-loader",
|
||||
options: {
|
||||
postcssOptions: {
|
||||
sourceMap: true,
|
||||
plugins: [
|
||||
require("cssnano")(),
|
||||
"postcss-preset-env", // applies autoprefixer
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: "sass-loader",
|
||||
options: {
|
||||
// Prefer `dart-sass`
|
||||
implementation: require("sass"),
|
||||
sourceMap: true,
|
||||
sassOptions: {
|
||||
quietDeps: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
filename: "[name].css",
|
||||
}),
|
||||
],
|
||||
|
||||
devtool: "source-map",
|
||||
|
||||
output: {
|
||||
path: path.join(__dirname, "../", "dist"),
|
||||
publicPath: "/dist",
|
||||
},
|
||||
|
||||
optimization: {
|
||||
splitChunks: {
|
||||
cacheGroups: {
|
||||
styles: {
|
||||
name: "styles",
|
||||
test: /\.css$/,
|
||||
chunks: "all",
|
||||
enforce: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user