Chore: webpack alias react and grafana-runtime to share singletons (#81789)

* Chore: webpack alias react and grafana-runtime to share singletons

* Move alias to dev webpack, add alias for grafana-data as well

* remove whitespace
pull/81901/head
Josh Hunt 1 year ago committed by GitHub
parent 7852ea012d
commit 57993f65ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12
      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: [

Loading…
Cancel
Save