webpack.js 1016 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. const path = require('path')
  2. const { VueLoaderPlugin } = require('vue-loader');
  3. module.exports = {
  4. entry: {
  5. 'settings-apps-users-management': path.join(__dirname, 'src', 'main-apps-users-management'),
  6. 'settings-admin-security': path.join(__dirname, 'src', 'main-admin-security'),
  7. 'settings-personal-security': path.join(__dirname, 'src', 'main-personal-security')
  8. },
  9. output: {
  10. path: path.resolve(__dirname, './js'),
  11. publicPath: '/',
  12. filename: 'vue-[name].js'
  13. },
  14. optimization: {
  15. splitChunks: {
  16. automaticNameDelimiter: '-',
  17. }
  18. },
  19. module: {
  20. rules: [
  21. {
  22. test: /\.css$/,
  23. use: [
  24. 'vue-style-loader', 'css-loader'
  25. ],
  26. },
  27. {
  28. test: /\.scss$/,
  29. use: [
  30. 'vue-style-loader', 'css-loader', 'sass-loader'
  31. ],
  32. },
  33. {
  34. test: /\.vue$/,
  35. loader: 'vue-loader'
  36. },
  37. {
  38. test: /\.js$/,
  39. loader: 'babel-loader',
  40. exclude: /node_modules/
  41. },
  42. ]
  43. },
  44. plugins: [
  45. new VueLoaderPlugin()
  46. ],
  47. resolve: {
  48. extensions: ['*', '.js', '.vue', '.json']
  49. }
  50. }