gatsby-node.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. const path = require('path');
  2. exports.onCreateWebpackConfig = ({ actions, loaders, getConfig }) => {
  3. // const webpackConfig = require('./webpack.config');
  4. // const babelConfig = require('./babel.config');
  5. // console.log({wp});
  6. // actions.setWebpackConfig(webpackConfig);
  7. const staticPrefix = path.join(__dirname, 'static');
  8. const sentryDjangoAppPath = path.join(__dirname, 'src/sentry/static/sentry');
  9. console.log({
  10. staticPrefix,
  11. sentryDjangoAppPath,
  12. });
  13. actions.setWebpackConfig({
  14. resolve: {
  15. // ⚠ Note the '..' in the path because the docz gatsby project lives in the `.docz` directory
  16. modules: ['node_modules'],
  17. alias: {
  18. 'react-dom$': 'react-dom/profiling',
  19. 'scheduler/tracing': 'scheduler/tracing-profiling',
  20. sentry: path.join(staticPrefix, 'app'),
  21. 'sentry-images': path.join(staticPrefix, 'images'),
  22. 'sentry-logos': path.join(sentryDjangoAppPath, 'images', 'logos'),
  23. 'sentry-fonts': path.join(staticPrefix, 'fonts'),
  24. // Aliasing this for getsentry's build, otherwise `less/select2` will not be able
  25. // to be resolved
  26. less: path.join(staticPrefix, 'less'),
  27. 'sentry-test': path.join(__dirname, 'tests', 'js', 'sentry-test'),
  28. 'sentry-locale': path.join(__dirname, 'src', 'sentry', 'locale'),
  29. 'ios-device-list': path.join(
  30. __dirname,
  31. 'node_modules',
  32. 'ios-device-list',
  33. 'dist',
  34. 'ios-device-list.min.js'
  35. ),
  36. },
  37. },
  38. });
  39. };