webpack.config.js 677 B

12345678910111213141516171819202122232425262728293031323334353637
  1. var path = require('path')
  2. var webpack = require('webpack')
  3. module.exports = {
  4. entry: ['./src/Main.js'],
  5. output: {
  6. path: path.resolve(__dirname, './dist'),
  7. filename: 'build.js',
  8. library: ['VueNativeSock'],
  9. libraryTarget: 'umd'
  10. },
  11. devtool: "source-map",
  12. plugins: [
  13. new webpack.optimize.UglifyJsPlugin({
  14. compress: {
  15. warnings: false
  16. }
  17. })
  18. ],
  19. resolve: {
  20. alias: {
  21. '@': path.resolve(__dirname, './src'),
  22. }
  23. },
  24. module: {
  25. loaders: [
  26. {
  27. test: /\.js$/,
  28. exclude: /node_modules/,
  29. loader: 'babel-loader',
  30. query: {
  31. presets: ['es2015']
  32. }
  33. }
  34. ]
  35. }
  36. }