[release-11 5.8] backport build fixes (#109465)
* [release-11.6.5] Update npm build in daggerbuild & revert some script changes (#109352) * update daggerbuild/frontend/npm.go * combine lerna commands * revert scripts changes (cherry picked from commit2d2d6d1ad5) * [release-11.6.5] update nx (#109400) * update nx (cherry picked from commit b065bf1fd9bd355614a2d3acd1eba3864267d042) * set some NX env variables * add make to cypress container * update cypress image * also install gcc * Also add g++ * upgrade lerna too (cherry picked from commit7d067d343a)
This commit is contained in:
@@ -4,7 +4,6 @@ const browserslist = require('browserslist');
|
||||
const { resolveToEsbuildTarget } = require('esbuild-plugin-browserslist');
|
||||
const ESLintPlugin = require('eslint-webpack-plugin');
|
||||
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
||||
const fs = require('fs');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const path = require('path');
|
||||
const { DefinePlugin, EnvironmentPlugin } = require('webpack');
|
||||
@@ -30,21 +29,6 @@ function getDecoupledPlugins() {
|
||||
return packages.filter((pkg) => pkg.dir.includes('plugins/datasource')).map((pkg) => `${pkg.dir}/**`);
|
||||
}
|
||||
|
||||
// When linking scenes for development, resolve the path to the src directory for sourcemaps
|
||||
function scenesModule() {
|
||||
const scenesPath = path.resolve('./node_modules/@grafana/scenes');
|
||||
try {
|
||||
const status = fs.lstatSync(scenesPath);
|
||||
if (status.isSymbolicLink()) {
|
||||
console.log(`scenes is linked to local scenes repo`);
|
||||
return path.resolve(scenesPath + '/src');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Error checking scenes path: ${error.message}`);
|
||||
}
|
||||
return scenesPath;
|
||||
}
|
||||
|
||||
const envConfig = getEnvConfig();
|
||||
|
||||
module.exports = (env = {}) => {
|
||||
@@ -68,10 +52,14 @@ module.exports = (env = {}) => {
|
||||
// Packages linked for development need react to be resolved from the same location
|
||||
react: path.resolve('./node_modules/react'),
|
||||
|
||||
// Also Grafana packages need to be resolved from the same location so they share
|
||||
// the same singletons
|
||||
'@grafana/runtime': path.resolve(__dirname, '../../packages/grafana-runtime'),
|
||||
'@grafana/data': path.resolve(__dirname, '../../packages/grafana-data'),
|
||||
|
||||
// This is required to correctly resolve react-router-dom when linking with
|
||||
// local version of @grafana/scenes
|
||||
'react-router-dom': path.resolve('./node_modules/react-router-dom'),
|
||||
'@grafana/scenes': scenesModule(),
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user