diff --git a/.betterer.results b/.betterer.results index 30d56746d77..2345eba8c89 100644 --- a/.betterer.results +++ b/.betterer.results @@ -3121,9 +3121,6 @@ exports[`better eslint`] = { "public/app/plugins/datasource/cloud-monitoring/types/types.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], - "public/app/plugins/datasource/cloud-monitoring/webpack.config.ts:5381": [ - [0, 0, 0, "Do not re-export imported variable (\`config\`)", "0"] - ], "public/app/plugins/datasource/cloudwatch/components/ConfigEditor/ConfigEditor.tsx:5381": [ [0, 0, 0, "Add noMargin prop to Field components to remove built-in margins. Use layout components like Stack or Grid with the gap prop instead for consistent spacing.", "0"], [0, 0, 0, "Add noMargin prop to Field components to remove built-in margins. Use layout components like Stack or Grid with the gap prop instead for consistent spacing.", "1"], @@ -3290,9 +3287,6 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"] ], - "public/app/plugins/datasource/grafana-testdata-datasource/webpack.config.ts:5381": [ - [0, 0, 0, "Do not re-export imported variable (\`config\`)", "0"] - ], "public/app/plugins/datasource/grafana/components/AnnotationQueryEditor.tsx:5381": [ [0, 0, 0, "Add noMargin prop to Field components to remove built-in margins. Use layout components like Stack or Grid with the gap prop instead for consistent spacing.", "0"], [0, 0, 0, "Add noMargin prop to Field components to remove built-in margins. Use layout components like Stack or Grid with the gap prop instead for consistent spacing.", "1"], @@ -3644,9 +3638,6 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "2"], [0, 0, 0, "Unexpected any. Specify a different type.", "3"] ], - "public/app/plugins/datasource/tempo/webpack.config.ts:5381": [ - [0, 0, 0, "Do not re-export imported variable (\`config\`)", "0"] - ], "public/app/plugins/datasource/zipkin/QueryField.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"] @@ -3657,9 +3648,6 @@ exports[`better eslint`] = { "public/app/plugins/datasource/zipkin/utils/transforms.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], - "public/app/plugins/datasource/zipkin/webpack.config.ts:5381": [ - [0, 0, 0, "Do not re-export imported variable (\`config\`)", "0"] - ], "public/app/plugins/panel/annolist/AnnoListPanel.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], diff --git a/e2e/test-plugins/grafana-extensionstest-app/package.json b/e2e/test-plugins/grafana-extensionstest-app/package.json index 5fe3da7246e..d11250bdc4d 100644 --- a/e2e/test-plugins/grafana-extensionstest-app/package.json +++ b/e2e/test-plugins/grafana-extensionstest-app/package.json @@ -3,8 +3,8 @@ "version": "12.1.0-pre", "private": true, "scripts": { - "build": "webpack -c ./webpack.config.ts --env production", - "dev": "webpack -w -c ./webpack.config.ts --env development", + "build": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production", + "dev": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -w -c ./webpack.config.ts --env development", "typecheck": "tsc --noEmit", "lint": "eslint --cache --ignore-path ./.gitignore --ext .js,.jsx,.ts,.tsx ." }, diff --git a/e2e/test-plugins/grafana-extensionstest-app/webpack.config.ts b/e2e/test-plugins/grafana-extensionstest-app/webpack.config.ts index 3303ed94f3c..6268c183d35 100644 --- a/e2e/test-plugins/grafana-extensionstest-app/webpack.config.ts +++ b/e2e/test-plugins/grafana-extensionstest-app/webpack.config.ts @@ -1,7 +1,7 @@ import CopyWebpackPlugin from 'copy-webpack-plugin'; -import grafanaConfig from '@grafana/plugin-configs/webpack.config'; +import grafanaConfig from '@grafana/plugin-configs/webpack.config.ts'; import { mergeWithCustomize, unique } from 'webpack-merge'; -import { Configuration } from 'webpack'; +import { type Configuration } from 'webpack'; function skipFiles(f: string): boolean { if (f.includes('/dist/')) { diff --git a/e2e/test-plugins/grafana-test-datasource/package.json b/e2e/test-plugins/grafana-test-datasource/package.json index 437d542510a..9f976341268 100644 --- a/e2e/test-plugins/grafana-test-datasource/package.json +++ b/e2e/test-plugins/grafana-test-datasource/package.json @@ -3,8 +3,8 @@ "version": "12.1.0-pre", "private": true, "scripts": { - "build": "webpack -c ./webpack.config.ts --env production", - "dev": "webpack -w -c ./webpack.config.ts --env development", + "build": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production", + "dev": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -w -c ./webpack.config.ts --env development", "typecheck": "tsc --noEmit", "lint": "eslint --cache --ignore-path ./.gitignore --ext .js,.jsx,.ts,.tsx ." }, diff --git a/e2e/test-plugins/grafana-test-datasource/webpack.config.ts b/e2e/test-plugins/grafana-test-datasource/webpack.config.ts index 3303ed94f3c..6268c183d35 100644 --- a/e2e/test-plugins/grafana-test-datasource/webpack.config.ts +++ b/e2e/test-plugins/grafana-test-datasource/webpack.config.ts @@ -1,7 +1,7 @@ import CopyWebpackPlugin from 'copy-webpack-plugin'; -import grafanaConfig from '@grafana/plugin-configs/webpack.config'; +import grafanaConfig from '@grafana/plugin-configs/webpack.config.ts'; import { mergeWithCustomize, unique } from 'webpack-merge'; -import { Configuration } from 'webpack'; +import { type Configuration } from 'webpack'; function skipFiles(f: string): boolean { if (f.includes('/dist/')) { diff --git a/packages/grafana-plugin-configs/package.json b/packages/grafana-plugin-configs/package.json index 845ae3a750f..ffd590576f5 100644 --- a/packages/grafana-plugin-configs/package.json +++ b/packages/grafana-plugin-configs/package.json @@ -6,6 +6,7 @@ "dependencies": { "tslib": "2.8.1" }, + "type": "module", "devDependencies": { "@grafana/tsconfig": "^2.0.0", "@swc/core": "1.10.12", diff --git a/packages/grafana-plugin-configs/tsconfig.json b/packages/grafana-plugin-configs/tsconfig.json index 1790c28c284..b7a0dd239e8 100644 --- a/packages/grafana-plugin-configs/tsconfig.json +++ b/packages/grafana-plugin-configs/tsconfig.json @@ -4,19 +4,11 @@ "alwaysStrict": true, "declaration": false, "resolveJsonModule": true, - "moduleResolution": "bundler" - }, - "ts-node": { - "compilerOptions": { - "module": "commonjs", - "target": "es5", - "moduleResolution": "Node", - "esModuleInterop": true - }, - "transpileOnly": true + "moduleResolution": "bundler", + "noEmit": true, + "allowImportingTsExtensions": true }, "extends": "@grafana/tsconfig", - "exclude": ["**/*.test.ts", "**/*.test.tsx", "**/*.spec.ts", "**/*.spec.tsx"], "include": ["./types", "."] } diff --git a/packages/grafana-plugin-configs/types/replace-in-webpack-plugin.d.ts b/packages/grafana-plugin-configs/types/replace-in-webpack-plugin.d.ts new file mode 100644 index 00000000000..746b3e0d303 --- /dev/null +++ b/packages/grafana-plugin-configs/types/replace-in-webpack-plugin.d.ts @@ -0,0 +1,23 @@ +declare module 'replace-in-file-webpack-plugin' { + import { Compiler, Plugin } from 'webpack'; + + interface ReplaceRule { + search: string | RegExp; + replace: string | ((match: string) => string); + } + + interface ReplaceOption { + dir?: string; + files?: string[]; + test?: RegExp | RegExp[]; + rules: ReplaceRule[]; + } + + class ReplaceInFilePlugin extends Plugin { + constructor(options?: ReplaceOption[]); + options: ReplaceOption[]; + apply(compiler: Compiler): void; + } + + export = ReplaceInFilePlugin; +} diff --git a/packages/grafana-plugin-configs/utils.ts b/packages/grafana-plugin-configs/utils.ts index 3a74dd90af6..7c517dc2d18 100644 --- a/packages/grafana-plugin-configs/utils.ts +++ b/packages/grafana-plugin-configs/utils.ts @@ -3,12 +3,19 @@ import { glob } from 'glob'; import path from 'path'; import process from 'process'; +// Support for node 22 and 24. Due to the many changes in importing json files +// across recent node versions we load the json files using fs for simplicity. +function loadJson(path: string) { + const rawJson = fs.readFileSync(path, 'utf8'); + return JSON.parse(rawJson); +} + export function getPackageJson() { - return require(path.resolve(process.cwd(), 'package.json')); + return loadJson(path.resolve(process.cwd(), 'package.json')); } export function getPluginJson() { - return require(path.resolve(process.cwd(), 'plugin.json')); + return loadJson(path.resolve(process.cwd(), 'plugin.json')); } export async function getEntries(): Promise> { diff --git a/packages/grafana-plugin-configs/webpack.config.ts b/packages/grafana-plugin-configs/webpack.config.ts index 7714093000a..86c1d1eafc9 100644 --- a/packages/grafana-plugin-configs/webpack.config.ts +++ b/packages/grafana-plugin-configs/webpack.config.ts @@ -2,15 +2,14 @@ import CopyWebpackPlugin from 'copy-webpack-plugin'; import ESLintPlugin from 'eslint-webpack-plugin'; import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'; import path from 'path'; -// @ts-expect-error - there are no types for this package import ReplaceInFileWebpackPlugin from 'replace-in-file-webpack-plugin'; import TerserPlugin from 'terser-webpack-plugin'; -import { type Configuration, BannerPlugin } from 'webpack'; +import webpack, { type Configuration } from 'webpack'; import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; import VirtualModulesPlugin from 'webpack-virtual-modules'; -import { DIST_DIR } from './constants'; -import { getPackageJson, getPluginJson, getEntries, hasLicense } from './utils'; +import { DIST_DIR } from './constants.ts'; +import { getPackageJson, getPluginJson, getEntries, hasLicense } from './utils.ts'; function skipFiles(f: string): boolean { if (f.includes('/dist/')) { @@ -54,9 +53,13 @@ const config = async (env: Env): Promise => { cache: { type: 'filesystem', buildDependencies: { - config: [__filename], + config: [import.meta.filename], }, - cacheDirectory: path.resolve(__dirname, '../../node_modules/.cache/webpack', path.basename(process.cwd())), + cacheDirectory: path.resolve( + import.meta.dirname, + '../../node_modules/.cache/webpack', + path.basename(process.cwd()) + ), }, context: process.cwd(), @@ -114,7 +117,7 @@ const config = async (env: Env): Promise => { test: /module\.tsx?$/, use: [ { - loader: require.resolve('imports-loader'), + loader: 'imports-loader', options: { imports: `side-effects grafana-public-path`, }, @@ -125,10 +128,10 @@ const config = async (env: Env): Promise => { exclude: /(node_modules)/, test: /\.[tj]sx?$/, use: { - loader: require.resolve('swc-loader'), + loader: 'swc-loader', options: { jsc: { - baseUrl: path.resolve(__dirname), + baseUrl: path.resolve(import.meta.dirname), target: 'es2015', loose: false, parser: { @@ -209,7 +212,7 @@ const config = async (env: Env): Promise => { plugins: [ virtualPublicPath, // Insert create plugin version information into the bundle so Grafana will load from cdn with script tags. - new BannerPlugin({ + new webpack.BannerPlugin({ banner: '/* [create-plugin] version: 5.22.0 */', raw: true, entryOnly: true, @@ -264,7 +267,7 @@ const config = async (env: Env): Promise => { extensions: ['.ts', '.tsx'], lintDirtyModulesOnly: true, // don't lint on start, only lint changed files cacheLocation: path.resolve( - __dirname, + import.meta.dirname, '../../node_modules/.cache/eslint-webpack-plugin', path.basename(process.cwd()), '.eslintcache' diff --git a/public/app/plugins/datasource/azuremonitor/package.json b/public/app/plugins/datasource/azuremonitor/package.json index 1cdbd9eae7b..2619deb5e98 100644 --- a/public/app/plugins/datasource/azuremonitor/package.json +++ b/public/app/plugins/datasource/azuremonitor/package.json @@ -48,9 +48,9 @@ "@grafana/runtime": "*" }, "scripts": { - "build": "webpack -c ./webpack.config.ts --env production", - "build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", - "dev": "webpack -w -c ./webpack.config.ts --env development", + "build": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production", + "build:commit": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", + "dev": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -w -c ./webpack.config.ts --env development", "i18n-extract": "i18next --config locales/i18next-parser.config.cjs" }, "packageManager": "yarn@4.9.2" diff --git a/public/app/plugins/datasource/azuremonitor/webpack.config.ts b/public/app/plugins/datasource/azuremonitor/webpack.config.ts index c831a42f307..301bafbd1f9 100644 --- a/public/app/plugins/datasource/azuremonitor/webpack.config.ts +++ b/public/app/plugins/datasource/azuremonitor/webpack.config.ts @@ -1,7 +1,7 @@ import type { Configuration } from 'webpack'; import { merge } from 'webpack-merge'; -import grafanaConfig from '@grafana/plugin-configs/webpack.config'; +import grafanaConfig from '@grafana/plugin-configs/webpack.config.ts'; const config = async (env: Record): Promise => { const baseConfig = await grafanaConfig(env); diff --git a/public/app/plugins/datasource/cloud-monitoring/package.json b/public/app/plugins/datasource/cloud-monitoring/package.json index f7f1c4ade4c..f476c47156c 100644 --- a/public/app/plugins/datasource/cloud-monitoring/package.json +++ b/public/app/plugins/datasource/cloud-monitoring/package.json @@ -48,9 +48,9 @@ "@grafana/runtime": "*" }, "scripts": { - "build": "webpack -c ./webpack.config.ts --env production", - "build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", - "dev": "webpack -w -c ./webpack.config.ts --env development" + "build": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production", + "build:commit": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", + "dev": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -w -c ./webpack.config.ts --env development" }, "packageManager": "yarn@4.9.2" } diff --git a/public/app/plugins/datasource/cloud-monitoring/webpack.config.ts b/public/app/plugins/datasource/cloud-monitoring/webpack.config.ts index 4da5a990cfa..7931eb9cb5c 100644 --- a/public/app/plugins/datasource/cloud-monitoring/webpack.config.ts +++ b/public/app/plugins/datasource/cloud-monitoring/webpack.config.ts @@ -1,3 +1,4 @@ -import config from '@grafana/plugin-configs/webpack.config'; +import config from '@grafana/plugin-configs/webpack.config.ts'; +// eslint-disable-next-line no-barrel-files/no-barrel-files export default config; diff --git a/public/app/plugins/datasource/grafana-postgresql-datasource/package.json b/public/app/plugins/datasource/grafana-postgresql-datasource/package.json index cc2fde9a4e3..2acfab5815d 100644 --- a/public/app/plugins/datasource/grafana-postgresql-datasource/package.json +++ b/public/app/plugins/datasource/grafana-postgresql-datasource/package.json @@ -33,9 +33,9 @@ "@grafana/runtime": "*" }, "scripts": { - "build": "webpack -c ./webpack.config.ts --env production", - "build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", - "dev": "webpack -w -c ./webpack.config.ts --env development" + "build": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production", + "build:commit": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", + "dev": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -w -c ./webpack.config.ts --env development" }, "packageManager": "yarn@4.9.2" } diff --git a/public/app/plugins/datasource/grafana-postgresql-datasource/webpack.config.ts b/public/app/plugins/datasource/grafana-postgresql-datasource/webpack.config.ts index 55a880fef5c..7931eb9cb5c 100644 --- a/public/app/plugins/datasource/grafana-postgresql-datasource/webpack.config.ts +++ b/public/app/plugins/datasource/grafana-postgresql-datasource/webpack.config.ts @@ -1,4 +1,4 @@ -import config from '@grafana/plugin-configs/webpack.config'; +import config from '@grafana/plugin-configs/webpack.config.ts'; // eslint-disable-next-line no-barrel-files/no-barrel-files export default config; diff --git a/public/app/plugins/datasource/grafana-pyroscope-datasource/package.json b/public/app/plugins/datasource/grafana-pyroscope-datasource/package.json index 65be0f55f6c..3fcf2bb95c9 100644 --- a/public/app/plugins/datasource/grafana-pyroscope-datasource/package.json +++ b/public/app/plugins/datasource/grafana-pyroscope-datasource/package.json @@ -42,9 +42,9 @@ "@grafana/runtime": "*" }, "scripts": { - "build": "webpack -c ./webpack.config.ts --env production", - "build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", - "dev": "webpack -w -c ./webpack.config.ts --env development" + "build": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production", + "build:commit": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", + "dev": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -w -c ./webpack.config.ts --env development" }, "packageManager": "yarn@4.9.2" } diff --git a/public/app/plugins/datasource/grafana-pyroscope-datasource/webpack.config.ts b/public/app/plugins/datasource/grafana-pyroscope-datasource/webpack.config.ts index 8e03497ddb2..7a579fa172b 100644 --- a/public/app/plugins/datasource/grafana-pyroscope-datasource/webpack.config.ts +++ b/public/app/plugins/datasource/grafana-pyroscope-datasource/webpack.config.ts @@ -1,4 +1,4 @@ -import config from '@grafana/plugin-configs/webpack.config'; +import config from '@grafana/plugin-configs/webpack.config.ts'; const configWithFallback = async (env: Record) => { const response = await config(env); diff --git a/public/app/plugins/datasource/grafana-testdata-datasource/package.json b/public/app/plugins/datasource/grafana-testdata-datasource/package.json index 5d1fa9adc72..1c71f41c562 100644 --- a/public/app/plugins/datasource/grafana-testdata-datasource/package.json +++ b/public/app/plugins/datasource/grafana-testdata-datasource/package.json @@ -41,9 +41,9 @@ "@grafana/runtime": "*" }, "scripts": { - "build": "webpack -c ./webpack.config.ts --env production", - "build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", - "dev": "webpack -w -c ./webpack.config.ts --env development" + "build": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production", + "build:commit": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", + "dev": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -w -c ./webpack.config.ts --env development" }, "packageManager": "yarn@4.9.2" } diff --git a/public/app/plugins/datasource/grafana-testdata-datasource/webpack.config.ts b/public/app/plugins/datasource/grafana-testdata-datasource/webpack.config.ts index 4da5a990cfa..7931eb9cb5c 100644 --- a/public/app/plugins/datasource/grafana-testdata-datasource/webpack.config.ts +++ b/public/app/plugins/datasource/grafana-testdata-datasource/webpack.config.ts @@ -1,3 +1,4 @@ -import config from '@grafana/plugin-configs/webpack.config'; +import config from '@grafana/plugin-configs/webpack.config.ts'; +// eslint-disable-next-line no-barrel-files/no-barrel-files export default config; diff --git a/public/app/plugins/datasource/jaeger/package.json b/public/app/plugins/datasource/jaeger/package.json index 383c155d43c..d32fdd415c7 100644 --- a/public/app/plugins/datasource/jaeger/package.json +++ b/public/app/plugins/datasource/jaeger/package.json @@ -44,9 +44,9 @@ "@grafana/runtime": "*" }, "scripts": { - "build": "webpack -c ./webpack.config.ts --env production", - "build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", - "dev": "webpack -w -c ./webpack.config.ts --env development" + "build": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production", + "build:commit": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", + "dev": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -w -c ./webpack.config.ts --env development" }, "packageManager": "yarn@4.9.2" } diff --git a/public/app/plugins/datasource/jaeger/webpack.config.ts b/public/app/plugins/datasource/jaeger/webpack.config.ts index 10ef5bd69a2..9ff90fccf0c 100644 --- a/public/app/plugins/datasource/jaeger/webpack.config.ts +++ b/public/app/plugins/datasource/jaeger/webpack.config.ts @@ -1,4 +1,8 @@ -import config from '@grafana/plugin-configs/webpack.config'; +import { createRequire } from 'node:module'; + +import config from '@grafana/plugin-configs/webpack.config.ts'; + +const require = createRequire(import.meta.url); const configWithFallback = async (env: Record) => { const response = await config(env); diff --git a/public/app/plugins/datasource/loki/package.json b/public/app/plugins/datasource/loki/package.json index 0fe5fbfdd7b..3cd58989823 100644 --- a/public/app/plugins/datasource/loki/package.json +++ b/public/app/plugins/datasource/loki/package.json @@ -44,9 +44,9 @@ "@grafana/runtime": "*" }, "scripts": { - "build": "webpack -c ./webpack.config.ts --env production", - "build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", - "dev": "webpack -w -c ./webpack.config.ts --env development" + "build": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production", + "build:commit": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", + "dev": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -w -c ./webpack.config.ts --env development" }, "packageManager": "yarn@4.9.2" } diff --git a/public/app/plugins/datasource/loki/webpack.config.ts b/public/app/plugins/datasource/loki/webpack.config.ts index 55a880fef5c..7931eb9cb5c 100644 --- a/public/app/plugins/datasource/loki/webpack.config.ts +++ b/public/app/plugins/datasource/loki/webpack.config.ts @@ -1,4 +1,4 @@ -import config from '@grafana/plugin-configs/webpack.config'; +import config from '@grafana/plugin-configs/webpack.config.ts'; // eslint-disable-next-line no-barrel-files/no-barrel-files export default config; diff --git a/public/app/plugins/datasource/mssql/package.json b/public/app/plugins/datasource/mssql/package.json index fa734fad0f5..7b8f678c101 100644 --- a/public/app/plugins/datasource/mssql/package.json +++ b/public/app/plugins/datasource/mssql/package.json @@ -35,9 +35,9 @@ "@grafana/runtime": "*" }, "scripts": { - "build": "webpack -c ./webpack.config.ts --env production", - "build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", - "dev": "webpack -w -c ./webpack.config.ts --env development", + "build": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production", + "build:commit": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", + "dev": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -w -c ./webpack.config.ts --env development", "i18n-extract": "i18next --config locales/i18next-parser.config.cjs" }, "packageManager": "yarn@4.9.2" diff --git a/public/app/plugins/datasource/mssql/webpack.config.ts b/public/app/plugins/datasource/mssql/webpack.config.ts index 2e981f9ea7c..af2e94ddecf 100644 --- a/public/app/plugins/datasource/mssql/webpack.config.ts +++ b/public/app/plugins/datasource/mssql/webpack.config.ts @@ -1,7 +1,7 @@ import type { Configuration } from 'webpack'; import { merge } from 'webpack-merge'; -import grafanaConfig from '@grafana/plugin-configs/webpack.config'; +import grafanaConfig from '@grafana/plugin-configs/webpack.config.ts'; const config = async (env: Record): Promise => { const baseConfig = await grafanaConfig(env); diff --git a/public/app/plugins/datasource/mysql/package.json b/public/app/plugins/datasource/mysql/package.json index 78c0d5c95d3..71f24047aa4 100644 --- a/public/app/plugins/datasource/mysql/package.json +++ b/public/app/plugins/datasource/mysql/package.json @@ -33,9 +33,9 @@ "@grafana/runtime": "*" }, "scripts": { - "build": "webpack -c ./webpack.config.ts --env production", - "build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", - "dev": "webpack -w -c ./webpack.config.ts --env development" + "build": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production", + "build:commit": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", + "dev": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -w -c ./webpack.config.ts --env development" }, "packageManager": "yarn@4.9.2" } diff --git a/public/app/plugins/datasource/mysql/webpack.config.ts b/public/app/plugins/datasource/mysql/webpack.config.ts index 55a880fef5c..7931eb9cb5c 100644 --- a/public/app/plugins/datasource/mysql/webpack.config.ts +++ b/public/app/plugins/datasource/mysql/webpack.config.ts @@ -1,4 +1,4 @@ -import config from '@grafana/plugin-configs/webpack.config'; +import config from '@grafana/plugin-configs/webpack.config.ts'; // eslint-disable-next-line no-barrel-files/no-barrel-files export default config; diff --git a/public/app/plugins/datasource/parca/package.json b/public/app/plugins/datasource/parca/package.json index 18c7a72fad7..5690290bb3a 100644 --- a/public/app/plugins/datasource/parca/package.json +++ b/public/app/plugins/datasource/parca/package.json @@ -34,9 +34,9 @@ "@grafana/runtime": "*" }, "scripts": { - "build": "webpack -c ./webpack.config.ts --env production", - "build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", - "dev": "webpack -w -c ./webpack.config.ts --env development" + "build": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production", + "build:commit": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", + "dev": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -w -c ./webpack.config.ts --env development" }, "packageManager": "yarn@4.9.2" } diff --git a/public/app/plugins/datasource/parca/webpack.config.ts b/public/app/plugins/datasource/parca/webpack.config.ts index 4da5a990cfa..31247bb11af 100644 --- a/public/app/plugins/datasource/parca/webpack.config.ts +++ b/public/app/plugins/datasource/parca/webpack.config.ts @@ -1,3 +1,3 @@ -import config from '@grafana/plugin-configs/webpack.config'; +import config from '@grafana/plugin-configs/webpack.config.ts'; export default config; diff --git a/public/app/plugins/datasource/tempo/package.json b/public/app/plugins/datasource/tempo/package.json index e7ac0f7c247..fa1710c1d6b 100644 --- a/public/app/plugins/datasource/tempo/package.json +++ b/public/app/plugins/datasource/tempo/package.json @@ -61,10 +61,10 @@ "@grafana/runtime": "*" }, "scripts": { - "build": "webpack -c ./webpack.config.ts --env production", + "build": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production", "build:stats": "yarn build --env stats --profile --json=compilation-stats.json", - "build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", - "dev": "webpack -w -c ./webpack.config.ts --env development" + "build:commit": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", + "dev": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -w -c ./webpack.config.ts --env development" }, "packageManager": "yarn@4.9.2" } diff --git a/public/app/plugins/datasource/tempo/webpack.config.ts b/public/app/plugins/datasource/tempo/webpack.config.ts index 4da5a990cfa..7931eb9cb5c 100644 --- a/public/app/plugins/datasource/tempo/webpack.config.ts +++ b/public/app/plugins/datasource/tempo/webpack.config.ts @@ -1,3 +1,4 @@ -import config from '@grafana/plugin-configs/webpack.config'; +import config from '@grafana/plugin-configs/webpack.config.ts'; +// eslint-disable-next-line no-barrel-files/no-barrel-files export default config; diff --git a/public/app/plugins/datasource/zipkin/package.json b/public/app/plugins/datasource/zipkin/package.json index d3e3633e78d..94a2c65a18e 100644 --- a/public/app/plugins/datasource/zipkin/package.json +++ b/public/app/plugins/datasource/zipkin/package.json @@ -37,9 +37,9 @@ "@grafana/runtime": "*" }, "scripts": { - "build": "webpack -c ./webpack.config.ts --env production", - "build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", - "dev": "webpack -w -c ./webpack.config.ts --env development" + "build": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production", + "build:commit": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", + "dev": "NODE_OPTIONS='--experimental-strip-types --no-warnings=ExperimentalWarning' webpack -w -c ./webpack.config.ts --env development" }, "packageManager": "yarn@4.9.2" } diff --git a/public/app/plugins/datasource/zipkin/webpack.config.ts b/public/app/plugins/datasource/zipkin/webpack.config.ts index 4da5a990cfa..7931eb9cb5c 100644 --- a/public/app/plugins/datasource/zipkin/webpack.config.ts +++ b/public/app/plugins/datasource/zipkin/webpack.config.ts @@ -1,3 +1,4 @@ -import config from '@grafana/plugin-configs/webpack.config'; +import config from '@grafana/plugin-configs/webpack.config.ts'; +// eslint-disable-next-line no-barrel-files/no-barrel-files export default config;