Files
grafana/scripts/webpack/sass.rule.js
Jack Westbrook e894b19c1a Build: Fix failing CSS asset paths (#95380)
* build(webpack): set publicpath and process urls to resolve assets correctly

* build(webpack): add back --progress to build

* Add local cdn

(cherry picked from commit 7a19523fa476fd5ff2d7669d116f5be462b100f5)

* chore(devenv): fix local_cdn path in ngnix conf

* chore(codeowners): add frontend-ops as owners of local_cdn docker block

---------

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2024-10-25 13:45:44 +02:00

42 lines
840 B
JavaScript

'use strict';
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
module.exports = function (options) {
return {
test: /\.(sa|sc|c)ss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
publicPath: './',
},
},
{
loader: 'css-loader',
options: {
importLoaders: 2,
url: options.preserveUrl,
sourceMap: options.sourceMap,
},
},
{
loader: 'postcss-loader',
options: {
sourceMap: options.sourceMap,
postcssOptions: {
config: path.resolve(__dirname),
},
},
},
{
loader: 'sass-loader',
options: {
sourceMap: options.sourceMap,
},
},
],
};
};