webpack.config.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. const path = require('path');
  2. const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
  3. module.exports = {
  4. entry: './blocks/offcanvas-menu/index.js',
  5. output: {
  6. path: path.resolve(__dirname, 'blocks/offcanvas-menu/build'),
  7. filename: 'index.build.js',
  8. },
  9. module: {
  10. rules: [
  11. {
  12. test: /\.js$/,
  13. exclude: /node_modules/,
  14. use: {
  15. loader: 'babel-loader'
  16. }
  17. }
  18. ]
  19. },
  20. plugins: [
  21. new BrowserSyncPlugin({
  22. host: 'localhost',
  23. port: 80,
  24. proxy: 'https://srh.stu/_mkt/edit/',
  25. https: {
  26. key: '/opt/homebrew/etc/httpd/ssl/srh.stu-key.pem',
  27. cert: '/opt/homebrew/etc/httpd/ssl/srh.stu.pem'
  28. },
  29. files: [
  30. './parts/**/*.html',
  31. './blocks/**/*.js',
  32. './assets/**/*.css',
  33. './**/*.php'
  34. ],
  35. open: true,
  36. reloadDelay: 50,
  37. watchEvents: ['change', 'add', 'unlink', 'addDir', 'unlinkDir'],
  38. injectChanges: true,
  39. notify: false
  40. })
  41. ]
  42. };