Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 

83 řádky
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. .addEntry('statistics', './assets/scripts/statistics.js')
  27. // When enabled, Webpack "splits" your files into smaller pieces for greater optimization.
  28. .splitEntryChunks()
  29. // will require an extra script tag for runtime.js
  30. // but, you probably want this, unless you're building a single-page app
  31. .enableSingleRuntimeChunk()
  32. /*
  33. * FEATURE CONFIG
  34. *
  35. * Enable & configure other features below. For a full
  36. * list of features, see:
  37. * https://symfony.com/doc/current/frontend.html#adding-more-features
  38. */
  39. .cleanupOutputBeforeBuild()
  40. // Displays build status system notifications to the user
  41. // .enableBuildNotifications()
  42. .enableSourceMaps(!Encore.isProduction())
  43. // enables hashed filenames (e.g. app.abc123.css)
  44. .enableVersioning(Encore.isProduction())
  45. // configure Babel
  46. // .configureBabel((config) => {
  47. // config.plugins.push('@babel/a-babel-plugin');
  48. // })
  49. // enables and configure @babel/preset-env polyfills
  50. .configureBabelPresetEnv((config) => {
  51. config.useBuiltIns = 'usage';
  52. config.corejs = '3.38';
  53. })
  54. // enables Sass/SCSS support
  55. .enableSassLoader()
  56. // uncomment if you use TypeScript
  57. //.enableTypeScriptLoader()
  58. // uncomment if you use React
  59. //.enableReactPreset()
  60. // uncomment to get integrity="..." attributes on your script & link tags
  61. // requires WebpackEncoreBundle 1.4 or higher
  62. //.enableIntegrityHashes(Encore.isProduction())
  63. // uncomment if you're having problems with a jQuery plugin
  64. //.autoProvidejQuery()
  65. ;
  66. module.exports = Encore.getWebpackConfig();