Skip to content

Commit e4ca2e0

Browse files
committed
refactor: use css-in-js for external css styling and icon fonts
1 parent 59341b9 commit e4ca2e0

29 files changed

+11350
-128
lines changed

.config/webpack/webpack.config.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
1111
import LiveReloadPlugin from 'webpack-livereload-plugin';
1212
import path from 'path';
1313
import ReplaceInFileWebpackPlugin from 'replace-in-file-webpack-plugin';
14-
import { Configuration } from 'webpack';
14+
import { Configuration, DefinePlugin } from 'webpack';
1515

1616
import { getPackageJson, getPluginJson, hasReadme, getEntries } from './utils';
1717
import { SOURCE_DIR, DIST_DIR } from './constants';
@@ -154,6 +154,10 @@ const config = async (env): Promise<Configuration> => ({
154154
},
155155

156156
plugins: [
157+
// Replace current plugin version in migration.ts
158+
new DefinePlugin({
159+
PLUGIN_VERSION: JSON.stringify(getPackageJson().version),
160+
}),
157161
new CopyWebpackPlugin({
158162
patterns: [
159163
// If src/README.md exists use it; otherwise the root README
@@ -163,12 +167,12 @@ const config = async (env): Promise<Configuration> => ({
163167
{ from: '../LICENSE', to: '.' },
164168
{ from: '../CHANGELOG.md', to: '.', force: true },
165169
{ from: '**/*.json', to: '.' }, // TODO<Add an error for checking the basic structure of the repo>
166-
{ from: '**/*.svg', to: '.', noErrorOnMissing: true }, // Optional
170+
// { from: '**/*.svg', to: '.', noErrorOnMissing: true }, // Optional
167171
{ from: '**/*.png', to: '.', noErrorOnMissing: true }, // Optional
168172
{ from: '**/*.html', to: '.', noErrorOnMissing: true }, // Optional
169173
{ from: 'img/**/*', to: '.', noErrorOnMissing: true }, // Optional
170174
{ from: 'libs/**/*', to: '.', noErrorOnMissing: true }, // Optional
171-
{ from: 'static/**/*', to: '.', noErrorOnMissing: true }, // Optional
175+
// { from: 'static/**/*', to: '.', noErrorOnMissing: true }, // Optional
172176
],
173177
}),
174178
// Replace certain template-variables in the README and plugin.json

jest-setup.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
// Jest setup provided by Grafana scaffolding
22
import './.config/jest-setup';
3+
4+
import path from 'path';
5+
6+
globalThis.PLUGIN_VERSION = require(path.resolve(process.cwd(), 'package.json')).version;

0 commit comments

Comments
 (0)