webpack.base.config.js 2.6 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. }
  31. },
  32. module: {
  33. loaders: [
  34. { test: /\.vue$/, loader: 'vue' },
  35. { test: /\.js$/, loader: 'babel', exclude: /node_modules/ },
  36. { test: /\.css$/, loader: 'style!css!autoprefixer'},
  37. { test: /\.scss$/, loader: 'style!css!sass'},
  38. { test: /\.(gif|jpg|png|woff|svg|eot|ttf)\??.*$/, loader: 'url-loader?limit=8192'},
  39. { test: /\.(html|tpl)$/, loader: 'html-loader' }
  40. ]
  41. },
  42. babel: {
  43. presets: ['es2015']
  44. },
  45. plugins: [
  46. // generateHtmlPlugin("index"),
  47. // new webpack.optimize.CommonsChunkPlugin(/* chunkName= */'vendor', /* filename= */'vendor.js', Infinity),
  48. // new webpack.ProvidePlugin({
  49. // $: "jquery",
  50. // jQuery: "jquery",
  51. // "window.jQuery": "jquery"
  52. // }),
  53. // new webpack.optimize.UglifyJsPlugin({ minimize: true }),
  54. // new ExtractTextPlugin("global.css"),
  55. // new webpack.DefinePlugin({
  56. // 'process.env': {
  57. // NODE_ENV: JSON.stringify("production")
  58. // }
  59. // }),
  60. ],
  61. extraPath: "../"
  62. };