webpack.config.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**
  2. * Build config for the v0.5.0 FSE migration (@wordpress/scripts + webpack).
  3. *
  4. * New theme source lives in src/ and compiles to build/ — kept separate from the
  5. * legacy gulp pipeline (js/v4-*, style.min.css) which still serves the live site
  6. * until the block templates supersede it (see _claude/notes/upgrade-plan.md).
  7. *
  8. * Custom-block entries (blocks/<name>/index.js) get added here as we build them
  9. * out in Phase 4, mirroring the srh theme.
  10. */
  11. const path = require('path');
  12. const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
  13. module.exports = {
  14. entry: {
  15. index: './src/index.js',
  16. },
  17. output: {
  18. path: path.resolve(__dirname, 'build'),
  19. filename: '[name].js',
  20. },
  21. module: {
  22. rules: [
  23. {
  24. test: /\.js$/,
  25. exclude: /node_modules/,
  26. use: { loader: 'babel-loader' },
  27. },
  28. {
  29. test: /\.css$/,
  30. use: ['style-loader', 'css-loader'],
  31. },
  32. ],
  33. },
  34. plugins: [
  35. new BrowserSyncPlugin({
  36. host: 'daw.stu',
  37. port: 3030,
  38. proxy: 'https://daw.stu',
  39. https: {
  40. key: '/opt/homebrew/etc/httpd/ssl/daw.stu-key.pem',
  41. cert: '/opt/homebrew/etc/httpd/ssl/daw.stu-cert.pem',
  42. },
  43. files: [
  44. './**/*.php',
  45. './src/**/*.js',
  46. './src/**/*.css',
  47. './templates/**/*.html',
  48. './parts/**/*.html',
  49. './patterns/**/*.php',
  50. './theme.json',
  51. ],
  52. ignore: ['node_modules', 'build', 'js/v4-*', '*.min.*'],
  53. open: 'external',
  54. reloadDelay: 50,
  55. injectChanges: true,
  56. notify: false,
  57. }),
  58. ],
  59. };