您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

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