代码拉取完成,页面将自动刷新
import type { Configuration } from 'webpack';
import { merge } from 'webpack-merge';
import grafanaConfig from './.config/webpack/webpack.config';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import RemoveEmptyScriptsPlugin from 'webpack-remove-empty-scripts';
const config = async (env): Promise<Configuration> => {
const baseConfig = await grafanaConfig(env);
return merge(baseConfig, {
// Add custom config here...
entry: {
module: './module.ts',
'datasource/module': './datasource/module.ts',
'panel-triggers/module': './panel-triggers/module.tsx',
dark: './styles/dark.scss',
light: './styles/light.scss',
},
module: {
rules: [
{
test: /(dark|light)\.scss$/,
exclude: /node_modules/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: {
importLoaders: 1,
url: false,
sourceMap: false,
},
},
{
loader: require.resolve('postcss-loader'),
options: {
postcssOptions: {
plugins: () => [
require('postcss-flexbugs-fixes'),
require('postcss-preset-env')({
autoprefixer: { flexbox: 'no-2009', grid: true },
}),
],
},
},
},
{
loader: 'sass-loader',
options: {
sourceMap: false,
},
},
],
},
],
},
plugins: [
new RemoveEmptyScriptsPlugin({}),
new MiniCssExtractPlugin({
filename: 'styles/[name].css',
}),
],
});
};
export default config;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。