Dejvino's Curriculum Vitae
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.
 
 
 

55 lines
1.2 KiB

  1. 'use strict'
  2. const path = require('path')
  3. const autoprefixer = require('autoprefixer')
  4. const HtmlWebpackPlugin = require('html-webpack-plugin')
  5. module.exports = {
  6. mode: 'development',
  7. entry: './src/js/main.js',
  8. output: {
  9. filename: 'main.js',
  10. path: path.resolve(__dirname, 'dist'),
  11. },
  12. devServer:{
  13. static: path.resolve(__dirname, 'dist'),
  14. port: 8080,
  15. hot: true
  16. },
  17. plugins: [
  18. new HtmlWebpackPlugin({ template: './src/index.html' })
  19. ],
  20. module: {
  21. rules: [
  22. {
  23. test: /\.(scss)$/,
  24. use: [
  25. {
  26. // Adds CSS to the DOM by injecting a `<style>` tag
  27. loader: 'style-loader'
  28. },
  29. {
  30. // Interprets `@import` and `url()` like `import/require()` and will resolve them
  31. loader: 'css-loader'
  32. },
  33. {
  34. // Loader for webpack to process CSS with PostCSS
  35. loader: 'postcss-loader',
  36. options: {
  37. postcssOptions: {
  38. plugins: () => [
  39. autoprefixer
  40. ]
  41. }
  42. }
  43. },
  44. {
  45. // Loads a SASS/SCSS file and compiles it to CSS
  46. loader: 'sass-loader'
  47. }
  48. ]
  49. }
  50. ]
  51. }
  52. }