Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

94 Zeilen
2.3 KiB

  1. 'use strict'
  2. const path = require('path')
  3. const utils = require('./utils')
  4. const config = require('../config')
  5. const {
  6. VueLoaderPlugin
  7. } = require('vue-loader')
  8. const vueLoaderConfig = require('./vue-loader.conf')
  9. function resolve(dir) {
  10. return path.join(__dirname, '..', dir)
  11. }
  12. module.exports = {
  13. context: path.resolve(__dirname, '../'),
  14. entry: {
  15. app: './src/main.js'
  16. },
  17. output: {
  18. path: config.build.assetsRoot,
  19. filename: '[name].js',
  20. publicPath: config.build.assetsPublicPath //process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath
  21. },
  22. resolve: {
  23. extensions: ['.js', '.vue', '.json'],
  24. alias: {
  25. '@': resolve('src')
  26. }
  27. },
  28. module: {
  29. rules: [{
  30. test: /\.vue$/,
  31. loader: 'vue-loader',
  32. options: vueLoaderConfig
  33. },
  34. {
  35. test: /\.js$/,
  36. loader: 'babel-loader',
  37. include: [
  38. resolve('src'),
  39. resolve('test'),
  40. resolve('node_modules/webpack-dev-server/client')
  41. ]
  42. },
  43. {
  44. test: /\.svg$/,
  45. loader: 'svg-sprite-loader',
  46. include: [resolve('src/icons')],
  47. options: {
  48. symbolId: 'icon-[name]'
  49. }
  50. },
  51. {
  52. test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
  53. loader: 'url-loader',
  54. exclude: [resolve('src/icons')],
  55. options: {
  56. limit: 10000,
  57. name: utils.assetsPath('img/[name].[hash:7].[ext]')
  58. }
  59. },
  60. {
  61. test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
  62. loader: 'url-loader',
  63. options: {
  64. limit: 10000,
  65. name: utils.assetsPath('media/[name].[hash:7].[ext]')
  66. }
  67. },
  68. {
  69. test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
  70. loader: 'url-loader',
  71. options: {
  72. limit: 10000,
  73. name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
  74. }
  75. }
  76. ]
  77. },
  78. plugins: [new VueLoaderPlugin()],
  79. node: {
  80. // prevent webpack from injecting useless setImmediate polyfill because Vue
  81. // source contains it (although only uses it if it's native).
  82. setImmediate: false,
  83. // prevent webpack from injecting mocks to Node native modules
  84. // that does not make sense for the client
  85. dgram: 'empty',
  86. fs: 'empty',
  87. net: 'empty',
  88. tls: 'empty',
  89. child_process: 'empty'
  90. }
  91. }