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.

108 lines
4.9KB

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