You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 line
2.7KB

  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 sub-directory deploy
  13. //.setManifestKeyPrefix('build/')
  14. .enableSassLoader()
  15. /*
  16. * ENTRY CONFIG
  17. *
  18. * Each entry will result in one JavaScript file (e.g. app.js)
  19. * and one CSS file (e.g. app.css) if your JavaScript imports CSS.
  20. */
  21. //.addEntry('backend-common', './assets/apps/backend/common/app.common.js')
  22. .addEntry('backend-common', './Lc/SovBundle/Resources/assets/apps/backend/common/app.common.js')
  23. //.addEntry('easyadmin', './vendor/easycorp/easyadmin-bundle/assets/js/app.js')
  24. // enables the Symfony UX Stimulus bridge (used in assets/bootstrap.js)
  25. .enableStimulusBridge('./assets/controllers.json')
  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. .enableBuildNotifications()
  40. .enableSourceMaps(!Encore.isProduction())
  41. // enables hashed filenames (e.g. app.abc123.css)
  42. .enableVersioning(Encore.isProduction())
  43. .configureBabel((config) => {
  44. config.plugins.push('@babel/plugin-proposal-class-properties');
  45. })
  46. // enables @babel/preset-env polyfills
  47. .configureBabelPresetEnv((config) => {
  48. config.useBuiltIns = 'usage';
  49. config.corejs = 3;
  50. })
  51. // enables Sass/SCSS support
  52. //.enableSassLoader()
  53. // uncomment if you use TypeScript
  54. //.enableTypeScriptLoader()
  55. // uncomment if you use React
  56. //.enableReactPreset()
  57. // uncomment to get integrity="..." attributes on your script & link tags
  58. // requires WebpackEncoreBundle 1.4 or higher
  59. //.enableIntegrityHashes(Encore.isProduction())
  60. // uncomment if you're having problems with a jQuery plugin
  61. //.autoProvidejQuery()
  62. ;
  63. module.exports = Encore.getWebpackConfig();