@grafana/create-plugin 4.13.0-canary.966.44ebd48.0 → 4.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/create-plugin",
|
|
3
|
-
"version": "4.13.0
|
|
3
|
+
"version": "4.13.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"directory": "packages/create-plugin",
|
|
6
6
|
"url": "https://github.com/grafana/plugin-tools"
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"engines": {
|
|
88
88
|
"node": ">=20"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "0d126394b9c16cdbd47e3749cb25f258a233ac1a"
|
|
91
91
|
}
|
|
@@ -11,7 +11,7 @@ import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
|
|
11
11
|
import LiveReloadPlugin from 'webpack-livereload-plugin';
|
|
12
12
|
import path from 'path';
|
|
13
13
|
import ReplaceInFileWebpackPlugin from 'replace-in-file-webpack-plugin';
|
|
14
|
-
import {
|
|
14
|
+
import { Configuration } from 'webpack';
|
|
15
15
|
|
|
16
16
|
import { getPackageJson, getPluginJson, hasReadme, getEntries, isWSL } from './utils';
|
|
17
17
|
import { SOURCE_DIR, DIST_DIR } from './constants';
|
|
@@ -34,8 +34,6 @@ const config = async (env): Promise<Configuration> => {
|
|
|
34
34
|
entry: await getEntries(),
|
|
35
35
|
|
|
36
36
|
externals: [
|
|
37
|
-
// Required for dynamic publicPath resolution
|
|
38
|
-
{ 'amd-module': 'module' },
|
|
39
37
|
'lodash',
|
|
40
38
|
'jquery',
|
|
41
39
|
'moment',
|
|
@@ -104,17 +102,6 @@ const config = async (env): Promise<Configuration> => {
|
|
|
104
102
|
},
|
|
105
103
|
},
|
|
106
104
|
},
|
|
107
|
-
{
|
|
108
|
-
test: /src\/(?:.*\/)?module\.tsx?$/,
|
|
109
|
-
use: [
|
|
110
|
-
{
|
|
111
|
-
loader: 'imports-loader',
|
|
112
|
-
options: {
|
|
113
|
-
imports: `side-effects ${path.join(__dirname, 'publicPath.ts')}`,
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
],
|
|
117
|
-
},
|
|
118
105
|
{
|
|
119
106
|
test: /\.css$/,
|
|
120
107
|
use: ['style-loader', 'css-loader'],
|
|
@@ -127,6 +114,9 @@ const config = async (env): Promise<Configuration> => {
|
|
|
127
114
|
test: /\.(png|jpe?g|gif|svg)$/,
|
|
128
115
|
type: 'asset/resource',
|
|
129
116
|
generator: {
|
|
117
|
+
// Keep publicPath relative for host.com/grafana/ deployments
|
|
118
|
+
publicPath: `public/plugins/${pluginJson.id}/img/`,
|
|
119
|
+
outputPath: 'img/',
|
|
130
120
|
filename: Boolean(env.production) ? '[hash][ext]' : '[file]',
|
|
131
121
|
},
|
|
132
122
|
},
|
|
@@ -134,7 +124,10 @@ const config = async (env): Promise<Configuration> => {
|
|
|
134
124
|
test: /\.(woff|woff2|eot|ttf|otf)(\?v=\d+\.\d+\.\d+)?$/,
|
|
135
125
|
type: 'asset/resource',
|
|
136
126
|
generator: {
|
|
137
|
-
|
|
127
|
+
// Keep publicPath relative for host.com/grafana/ deployments
|
|
128
|
+
publicPath: `public/plugins/${pluginJson.id}/fonts/`,
|
|
129
|
+
outputPath: 'fonts/',
|
|
130
|
+
filename: Boolean(env.production) ? '[hash][ext]' : '[name][ext]',
|
|
138
131
|
},
|
|
139
132
|
},
|
|
140
133
|
],
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️
|
|
3
|
-
*
|
|
4
|
-
* This file dynamically sets the public path at runtime based on the location of the plugin's AMD module.
|
|
5
|
-
* It relies on the magic `module` which is defined by the AMD loader.
|
|
6
|
-
* https://github.com/requirejs/requirejs/wiki/Differences-between-the-simplified-CommonJS-wrapper-and-standard-AMD-define#module
|
|
7
|
-
*
|
|
8
|
-
* We fallback to the plugin root so that older versions of Grafana will continue to load the plugin correctly.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
// @ts-nocheck
|
|
12
|
-
import amdMetaModule from 'amd-module';
|
|
13
|
-
|
|
14
|
-
__webpack_public_path__ =
|
|
15
|
-
amdMetaModule && amdMetaModule.uri
|
|
16
|
-
? amdMetaModule.uri.slice(0, amdMetaModule.uri.lastIndexOf('/') + 1)
|
|
17
|
-
: 'public/plugins/heywesty-trafficlight-panel/';
|