webpack.config.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. const ExtractTextPlugin = require('extract-text-webpack-plugin');
  2. const path = require('path');
  3. module.exports = {
  4. entry: {
  5. index: './style/index.css',
  6. embed: './style/embed.css'
  7. },
  8. output: {
  9. path: path.resolve(__dirname, 'static'),
  10. // we won't use these JS files, only the extracted CSS
  11. filename: '[name].js'
  12. },
  13. module: {
  14. rules: [
  15. {
  16. test: /\.css$/,
  17. use: ExtractTextPlugin.extract({
  18. fallback: 'style-loader',
  19. use: 'css-loader'
  20. })
  21. },
  22. {
  23. test: /\.svg/,
  24. use: [
  25. {
  26. loader: 'svg-url-loader',
  27. options: {}
  28. },
  29. {
  30. loader: 'svgo-loader',
  31. options: {
  32. plugins: []
  33. }
  34. }
  35. ]
  36. },
  37. {
  38. test: /\.(png|jpg|gif|ttf|woff|woff2|eot)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
  39. use: [
  40. {
  41. loader: 'url-loader',
  42. options: {
  43. limit: 10000
  44. }
  45. }
  46. ]
  47. }
  48. ]
  49. },
  50. plugins: [new ExtractTextPlugin('[name].css')]
  51. };