webpack.config.js 901 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. const path = require('path');
  2. const webpack = require('webpack');
  3. const ExtractTextPlugin = require("extract-text-webpack-plugin");
  4. const eCSS = new ExtractTextPlugin("libs.css");
  5. module.exports = {
  6. context: __dirname,
  7. entry: {
  8. main: path.join(__dirname, "webSource/index.js")
  9. },
  10. output: {
  11. path: "web/",
  12. filename: "bundle.js"
  13. },
  14. module: {
  15. rules: [
  16. {
  17. test: /\.css$/,
  18. use: eCSS.extract({
  19. fallback: "style-loader",
  20. use: "css-loader"
  21. })
  22. },
  23. {
  24. test: /\.vue$/,
  25. use:"vue-loader"
  26. }
  27. ]
  28. },
  29. plugins: [
  30. new webpack.ProvidePlugin({
  31. jQuery: 'jquery',
  32. $: 'jquery',
  33. jquery: 'jquery',
  34. Tether: 'tether'
  35. }),
  36. eCSS
  37. ],
  38. resolve: {
  39. alias: {
  40. 'vue$': 'vue/dist/vue.common.js',
  41. 'vue-router': "vue-router/dist/vue-router.common.js"
  42. }
  43. }
  44. };