Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. const HtmlWebpackPlugin = require('html-webpack-plugin');
  2.  
  3. module.exports = {
  4. entry: {
  5. polyfill: 'babel-polyfill',
  6. app: './src/index.js',
  7. 'function-file': './function-file/function-file.js'
  8. },
  9. module: {
  10. rules: [
  11. {
  12. test: /.js$/,
  13. exclude: /node_modules/,
  14. use: 'babel-loader'
  15. },
  16. {
  17. test: /.html$/,
  18. exclude: /node_modules/,
  19. use: 'html-loader'
  20. },
  21. {
  22. test: /.(png|jpg|jpeg|gif)$/,
  23. use: 'file-loader'
  24. }
  25. ]
  26. },
  27. plugins: [
  28. new HtmlWebpackPlugin({
  29. template: './index.html',
  30. chunks: ['polyfill', 'app']
  31. }),
  32. new HtmlWebpackPlugin({
  33. template: './function-file/function-file.html',
  34. filename: 'function-file/function-file.html',
  35. chunks: ['function-file']
  36. })
  37. ]
  38. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement