diff --git a/scripts/webpack/webpack.dev.js b/scripts/webpack/webpack.dev.js index 96a59ef004b..79a690c3a35 100644 --- a/scripts/webpack/webpack.dev.js +++ b/scripts/webpack/webpack.dev.js @@ -35,6 +35,18 @@ module.exports = (env = {}) => { ignored: /node_modules/, }, + resolve: { + alias: { + // Packages linked for development need react to be resolved from the same location + react: require.resolve('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'), + }, + }, + module: { // Note: order is bottom-to-top and/or right-to-left rules: [