25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 

82 satır
2.7 KiB

  1. const Encore = require('@symfony/webpack-encore');
  2. // Manually configure the runtime environment if not already configured yet by the "encore" command.
  3. // It's useful when you use tools that rely on webpack.config.js file.
  4. if (!Encore.isRuntimeEnvironmentConfigured()) {
  5. Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
  6. }
  7. Encore
  8. // directory where compiled assets will be stored
  9. .setOutputPath('public/build/')
  10. // public path used by the web server to access the output path
  11. .setPublicPath('/build')
  12. // only needed for CDN's or subdirectory deploy
  13. //.setManifestKeyPrefix('build/')
  14. /*
  15. * ENTRY CONFIG
  16. *
  17. * Each entry will result in one JavaScript file (e.g. app.js)
  18. * and one CSS file (e.g. app.css) if your JavaScript imports CSS.
  19. */
  20. .addEntry('app', './assets/app.js')
  21. .addEntry('crud', './assets/scripts/crud.js')
  22. .addEntry('registration', './assets/scripts/registration.js')
  23. .addEntry('team', './assets/scripts/team.js')
  24. .addEntry('account', './assets/scripts/account.js')
  25. .addEntry('report', './assets/scripts/report.js')
  26. // When enabled, Webpack "splits" your files into smaller pieces for greater optimization.
  27. .splitEntryChunks()
  28. // will require an extra script tag for runtime.js
  29. // but, you probably want this, unless you're building a single-page app
  30. .enableSingleRuntimeChunk()
  31. /*
  32. * FEATURE CONFIG
  33. *
  34. * Enable & configure other features below. For a full
  35. * list of features, see:
  36. * https://symfony.com/doc/current/frontend.html#adding-more-features
  37. */
  38. .cleanupOutputBeforeBuild()
  39. // Displays build status system notifications to the user
  40. // .enableBuildNotifications()
  41. .enableSourceMaps(!Encore.isProduction())
  42. // enables hashed filenames (e.g. app.abc123.css)
  43. .enableVersioning(Encore.isProduction())
  44. // configure Babel
  45. // .configureBabel((config) => {
  46. // config.plugins.push('@babel/a-babel-plugin');
  47. // })
  48. // enables and configure @babel/preset-env polyfills
  49. .configureBabelPresetEnv((config) => {
  50. config.useBuiltIns = 'usage';
  51. config.corejs = '3.38';
  52. })
  53. // enables Sass/SCSS support
  54. .enableSassLoader()
  55. // uncomment if you use TypeScript
  56. //.enableTypeScriptLoader()
  57. // uncomment if you use React
  58. //.enableReactPreset()
  59. // uncomment to get integrity="..." attributes on your script & link tags
  60. // requires WebpackEncoreBundle 1.4 or higher
  61. //.enableIntegrityHashes(Encore.isProduction())
  62. // uncomment if you're having problems with a jQuery plugin
  63. //.autoProvidejQuery()
  64. ;
  65. module.exports = Encore.getWebpackConfig();