You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

webpack.config.js 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. var WebPack = require('webpack');
  2. var HtmlPlugin = require('html-webpack-plugin');
  3. var HasteResolver = require('haste-resolver-webpack-plugin');
  4. module.exports = {
  5. output: {
  6. filename: 'bundle.js',
  7. path: __dirname + '/dist',
  8. publicPath: '/'
  9. },
  10. cache: true,
  11. debug: true,
  12. devtool: 'source-map',
  13. entry: {
  14. app: __dirname + '/index.web.js'
  15. },
  16. plugins: [
  17. new HasteResolver({
  18. platform: 'web'
  19. }),
  20. new HtmlPlugin({
  21. filename: 'index.html',
  22. template: __dirname + '/index-template.html'
  23. })
  24. ],
  25. module: {
  26. loaders: [
  27. // Load CSS files that are required in modules.
  28. {
  29. test: /\.css$/,
  30. exclude: /node_modules/,
  31. loader: 'style-loader!css-loader',
  32. },
  33. // Load font files for font-awesome. It uses a trailing version
  34. // number in the names when requiring so we have to accept them in
  35. // our test regex.
  36. {
  37. test: /\.(eot|svg|ttf)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
  38. loader: "file-loader"
  39. },
  40. {
  41. test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
  42. loader: "url-loader?limit=10000&minetype=application/font-woff"
  43. },
  44. // Process all JavaScript files as ECMAScript2015 along with
  45. // accepting the JSX syntax used by React.
  46. {
  47. test: /\.jsx?$/,
  48. exclude: /node_modules/,
  49. loader: 'babel-loader',
  50. query: {
  51. presets: ['es2015', 'react', 'stage-1']
  52. }
  53. },
  54. // Disable AMD for Strophe and its plugins because we don't know how
  55. // to require them successfully.
  56. {
  57. test: /\/strophe(js-plugins)?\//,
  58. loader: 'imports?define=>false&this=>window'
  59. }
  60. ]
  61. }
  62. };