Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

92 lines
3.4KB

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