webpack.config.js 816 B

1234567891011121314151617181920212223242526272829303132
  1. const path = require('path');
  2. const webpack = require('webpack');
  3. module.exports = {
  4. entry: ['./lofig.js'],
  5. output: {
  6. path: path.resolve('./dist'),
  7. filename: 'lofig.min.js'
  8. },
  9. resolveLoader: {
  10. root: path.join(__dirname, 'node_modules'),
  11. },
  12. module: {
  13. loaders: [
  14. {
  15. test: /\.js$/,
  16. loader: 'babel',
  17. exclude: /node_modules/,
  18. query: {
  19. presets: ['es2015']
  20. }
  21. }
  22. ]
  23. },
  24. plugins: [
  25. new webpack.HotModuleReplacementPlugin(),
  26. new webpack.ProvidePlugin({
  27. 'Promise': 'bluebird',
  28. 'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
  29. }),
  30. ]
  31. };