Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

105 lines
4.5KB

  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. const path = require('path');
  8. Encore
  9. // directory where compiled assets will be stored
  10. .setOutputPath('public/build/')
  11. // public path used by the web server to access the output path
  12. .setPublicPath('/build')
  13. // only needed for CDN's or sub-directory deploy
  14. //.setManifestKeyPrefix('build/')
  15. .enableSassLoader()
  16. .addAliases({
  17. 'core-js': path.resolve(__dirname, './node_modules/core-js'),
  18. 'jquery': path.join(__dirname, 'node_modules/jquery/src/jquery'),
  19. 'jquery-ui': path.join(__dirname, 'node_modules/jquery-ui-dist/jquery-ui'),
  20. 'adminlte-js': path.resolve(__dirname, 'node_modules/admin-lte/dist/js/adminlte.min.js'),
  21. 'adminlte-css': path.resolve(__dirname, 'node_modules/admin-lte/dist/css/adminlte.min.css'),
  22. 'fontawesome-css': path.resolve(__dirname, 'node_modules/admin-lte/plugins/fontawesome-free/css/all.css'),
  23. 'adminlte-plugin': path.resolve(__dirname, './node_modules/admin-lte/plugins/'),
  24. /*'adminlte': path.resolve(__dirname, './node_modules/admin-lte/dist/js/adminlte.min.js'),
  25. 'adminltePlugin': path.resolve(__dirname, './node_modules/admin-lte/plugins/'),
  26. 'admin-lte-css': path.resolve(__dirname, './node_modules/admin-lte/dist/css/adminlte.css'),
  27. 'core-js': path.resolve(__dirname, './node_modules/core-js'),
  28. 'jquery': path.join(__dirname, 'node_modules/jquery/src/jquery'),
  29. 'select2': path.join(__dirname, 'node_modules/select2/dist/js/select2.js'),
  30. 'select2-css': path.join(__dirname, 'node_modules/select2/dist/css/select2.min.css'),*/
  31. //'select2-bootstrap-theme': path.join(__dirname, 'node_modules/select2-bootstrap-5-theme/dist/select2-bootstrap-5-theme.min.css')
  32. })
  33. /*
  34. * ENTRY CONFIG
  35. *
  36. * Each entry will result in one JavaScript file (e.g. app.js)
  37. * and one CSS file (e.g. app.css) if your JavaScript imports CSS.
  38. */
  39. //.addEntry('backend-common', './assets/apps/backend/common/app.common.js')
  40. //.addEntry('jquery', './node_modules/jquery/dist/jquery.slim.js')
  41. .addEntry('backend-common', './Lc/SovBundle/Resources/assets/apps/backend-common/app.common.js')
  42. .addEntry('form', './Lc/SovBundle/Resources/assets/apps/form/app.form.js')
  43. .addEntry('field-filemanager', './Lc/SovBundle/Resources/assets/fields/filemanager/app.field-filemanager.js')
  44. .addEntry('field-collection', './Lc/SovBundle/Resources/assets/fields/collection/app.field-collection.js')
  45. //.addEntry('tabler', './Lc/SovBundle/Resources/assets/apps/tabler/app.tabler.js')
  46. //.addEntry('easyadmin', './vendor/easycorp/easyadmin-bundle/assets/js/app.js')
  47. // enables the Symfony UX Stimulus bridge (used in assets/bootstrap.js)
  48. .enableStimulusBridge('./assets/controllers.json')
  49. // When enabled, Webpack "splits" your files into smaller pieces for greater optimization.
  50. .splitEntryChunks()
  51. // will require an extra script tag for runtime.js
  52. // but, you probably want this, unless you're building a single-page app
  53. .enableSingleRuntimeChunk()
  54. /*
  55. * FEATURE CONFIG
  56. *
  57. * Enable & configure other features below. For a full
  58. * list of features, see:
  59. * https://symfony.com/doc/current/frontend.html#adding-more-features
  60. */
  61. .cleanupOutputBeforeBuild()
  62. .enableBuildNotifications()
  63. .enableSourceMaps(!Encore.isProduction())
  64. // enables hashed filenames (e.g. app.abc123.css)
  65. .enableVersioning(Encore.isProduction())
  66. .configureBabel((config) => {
  67. config.plugins.push('@babel/plugin-proposal-class-properties');
  68. })
  69. // enables @babel/preset-env polyfills
  70. .configureBabelPresetEnv((config) => {
  71. config.useBuiltIns = 'usage';
  72. config.corejs = 3;
  73. })
  74. // enables Sass/SCSS support
  75. //.enableSassLoader()
  76. // uncomment if you use TypeScript
  77. //.enableTypeScriptLoader()
  78. // uncomment if you use React
  79. //.enableReactPreset()
  80. // uncomment to get integrity="..." attributes on your script & link tags
  81. // requires WebpackEncoreBundle 1.4 or higher
  82. //.enableIntegrityHashes(Encore.isProduction())
  83. // uncomment if you're having problems with a jQuery plugin
  84. //.autoProvidejQuery()
  85. ;
  86. module.exports = Encore.getWebpackConfig();