Guest User

Untitled

a guest
Jul 22nd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. const path = require('path')
  2. const HtmlWebpackPlugin = require('html-webpack-plugin');
  3. const CopyWebpackPlugin = require('copy-webpack-plugin');
  4.  
  5. module.exports = {
  6. entry: './src/index.js',
  7. output: {
  8. path: path.join(__dirname, '/dist'),
  9. filename: 'bundle.js',
  10. },
  11.  
  12. resolve: {
  13. alias: {
  14. '@': path.resolve(__dirname, 'src/'),
  15. },
  16. },
  17.  
  18. module: {
  19. rules: [
  20. {
  21. test: /\.js$/,
  22. exclude: /node_modules/,
  23. use: {
  24. loader: 'babel-loader'
  25. },
  26. },
  27. {
  28. test: /\.css$/,
  29. use: [
  30. {
  31. loader: 'style-loader',
  32. },
  33. {
  34. loader: 'css-loader',
  35. },
  36. {
  37. loader: 'sass-loader',
  38. options: {
  39. includePaths: ['./node_modules', './node_modules/bootstrap/scss'],
  40. }
  41. },
  42. ],
  43. },
  44. {
  45. test: /\.(png|woff|woff2|eot|ttf|svg)$/,
  46. use: {
  47. loader: 'url-loader'
  48. }
  49. },
  50. ],
  51. },
  52.  
  53. plugins: [
  54. new HtmlWebpackPlugin({
  55. template: './src/index.html',
  56. }),
  57. new CopyWebpackPlugin([
  58. {
  59. from: 'static/*',
  60. to: 'dist/static'
  61. }
  62. ]),
  63. ],
  64.  
  65. devServer: {
  66. host: '0.0.0.0',
  67. port: 8080
  68. },
  69. };
Add Comment
Please, Sign In to add comment