webpack.base.config.js 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. var webpack = require('webpack');
  2. var path = require('path');
  3. module.exports = {
  4. entry: {
  5. main : "./main.js",
  6. vendors: ['jquery', 'rem', 'vue'],
  7. },
  8. output: {
  9. },
  10. resolve: {
  11. extensions: ['', '.js', '.vue'],
  12. alias: {
  13. "vue": 'vue/dist/vue.js',
  14. "rem": path.resolve(__dirname, './depend/rem/rem.js'),
  15. "underscore": path.resolve(__dirname, './depend/underscore/underscore.js'),
  16. "popup": path.resolve(__dirname, './depend/artDialog/popup.js'),
  17. "dialog-config": path.resolve(__dirname, './depend/artDialog/dialog-config.js'),
  18. "form": path.resolve(__dirname, './depend/form/form.js'),
  19. "md5": path.resolve(__dirname, './depend/md5/md5.js'),
  20. "template": path.resolve(__dirname, './depend/artTemplate/template.js'),
  21. "cookie": path.resolve(__dirname, './depend/cookie/cookie.js'),
  22. "store": path.resolve(__dirname, './depend/store/store.js'),
  23. "jweixin": path.resolve(__dirname, './depend/jweixin/jweixin-1.0.0.js'),
  24. "lib": path.resolve(__dirname, './depend/lib/lib.js'),
  25. "BDY": path.resolve(__dirname, './depend/BDY/BDY.js'),
  26. "lrz": path.resolve(__dirname, './depend/localResizeIMG/lrz.all.bundle.js'),
  27. "nprogress": path.resolve(__dirname, './depend/nprogress/nprogress.js'),
  28. "photoswipe": path.resolve(__dirname, './depend/components/photoswipe.js'),
  29. "dialog": path.resolve(__dirname, './depend/components/dialog.js'),
  30. "extSdk": path.resolve(__dirname, './depend/extSdk/extSdk.js')
  31. }
  32. },
  33. module: {
  34. loaders: [
  35. { test: /\.vue$/, loader: 'vue' },
  36. { test: /\.js$/, loader: 'babel', exclude: /node_modules/ },
  37. { test: /\.css$/, loader: 'style!css!autoprefixer'},
  38. { test: /\.scss$/, loader: 'style!css!sass'},
  39. { test: /\.(gif|jpg|png|woff|svg|eot|ttf)\??.*$/, loader: 'url-loader?limit=15315'},
  40. { test: /\.(html|tpl)$/, loader: 'html-loader' }
  41. ]
  42. },
  43. babel: {
  44. presets: ['es2015']
  45. },
  46. plugins: [
  47. // generateHtmlPlugin("index"),
  48. // new webpack.optimize.CommonsChunkPlugin(/* chunkName= */'vendor', /* filename= */'vendor.js', Infinity),
  49. // new webpack.ProvidePlugin({
  50. // $: "jquery",
  51. // jQuery: "jquery",
  52. // "window.jQuery": "jquery"
  53. // }),
  54. // new webpack.optimize.UglifyJsPlugin({ minimize: true }),
  55. // new ExtractTextPlugin("global.css"),
  56. // new webpack.DefinePlugin({
  57. // 'process.env': {
  58. // NODE_ENV: JSON.stringify("production")
  59. // }
  60. // }),
  61. ],
  62. extraPath: "../../../pub/p/fhvideo/"
  63. };