# What this PR does Schedule two-weeks and monthly view, UI polishing ## Which issue(s) this PR closes https://github.com/grafana/oncall-private/issues/2667 ## Checklist - [x] Unit, integration, and e2e (if applicable) tests updated - [x] Documentation added (or `pr:no public docs` PR label added if not required) - [x] Added the relevant release notes label (see labels prefixed w/ `release:`). These labels dictate how your PR will show up in the autogenerated release notes. --------- Co-authored-by: Dominik Broj <dominik.broj@grafana.com>
88 lines
2.2 KiB
TypeScript
88 lines
2.2 KiB
TypeScript
import { Configuration, DefinePlugin, EnvironmentPlugin } from 'webpack';
|
|
import LiveReloadPlugin from 'webpack-livereload-plugin';
|
|
import { mergeWithRules, CustomizeRule } from 'webpack-merge';
|
|
|
|
import grafanaConfig from './.config/webpack/webpack.config';
|
|
|
|
const dotenv = require('dotenv');
|
|
|
|
const config = async (env): Promise<Configuration> => {
|
|
const baseConfig = await grafanaConfig(env);
|
|
const customConfig = {
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.[tj]sx?$/,
|
|
use: {
|
|
options: {
|
|
jsc: {
|
|
parser: {
|
|
decorators: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
test: /\.s[ac]ss$/,
|
|
use: [
|
|
'style-loader',
|
|
{
|
|
loader: 'css-loader',
|
|
options: {
|
|
modules: {
|
|
auto: true,
|
|
localIdentName: env.development ? '[path][name]__[local]' : '[name]__[hash:base64]',
|
|
},
|
|
},
|
|
},
|
|
'sass-loader',
|
|
],
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: [
|
|
'style-loader',
|
|
{
|
|
loader: 'css-loader',
|
|
options: {
|
|
modules: {
|
|
auto: true,
|
|
localIdentName: env.development ? '[path][name]__[local]' : '[name]__[hash:base64]',
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
watchOptions: {
|
|
ignored: ['**/node_modules/', '**/dist'],
|
|
},
|
|
plugins: [
|
|
...(baseConfig.plugins?.filter((plugin) => !(plugin instanceof LiveReloadPlugin)) || []),
|
|
...(env.development ? [new LiveReloadPlugin({ appendScriptTag: true, useSourceHash: true })] : []),
|
|
new EnvironmentPlugin({
|
|
ONCALL_API_URL: null,
|
|
}),
|
|
new DefinePlugin({
|
|
'process.env': JSON.stringify(dotenv.config().parsed),
|
|
}),
|
|
],
|
|
};
|
|
|
|
return mergeWithRules({
|
|
module: {
|
|
rules: {
|
|
test: CustomizeRule.Match,
|
|
use: CustomizeRule.Merge,
|
|
},
|
|
},
|
|
watchOptions: {
|
|
use: CustomizeRule.Merge,
|
|
},
|
|
plugins: CustomizeRule.Replace,
|
|
})(baseConfig, customConfig);
|
|
};
|
|
|
|
export default config;
|