Advertisement
Guest User

Untitled

a guest
Feb 25th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. const ExtractTextPlugin = require('extract-text-webpack-plugin');
  2. const path = require('path');
  3.  
  4. module.exports = {
  5. entry: ['./src/js/index.js'],
  6. output: {
  7. filename: 'app.bundle.js',
  8. path: path.resolve(__dirname, 'src/assets'),
  9. publicPath: '/assets/',
  10. },
  11. devtool: 'source-map',
  12. module: {
  13. rules: [{
  14. test: /.scss$/,
  15. use: ExtractTextPlugin.extract({
  16. fallback: 'style-loader',
  17. use: ['css-loader', 'sass-loader'],
  18. publicPath: '/assets/',
  19. }),
  20. }],
  21. },
  22. devServer: {
  23. contentBase: path.resolve(__dirname, 'src'),
  24. compress: false,
  25. publicPath: 'http://localhost:8080/assets/',
  26. // port: 8080,
  27. watchContentBase: true,
  28. public: 'app.dev',
  29. proxy: {
  30. '/api': {
  31. target: 'http://app.dev',
  32. secure: false,
  33. },
  34. },
  35. },
  36. plugins: [
  37. new ExtractTextPlugin({
  38. filename: 'app.css',
  39. disable: false,
  40. allChunks: true,
  41. }),
  42. ],
  43. };
  44.  
  45. "scripts": {
  46. "dev": "webpack-dev-server --hot --inline --open",
  47. "prod": "webpack -p"
  48. }
  49.  
  50. yarn run v0.19.1
  51. $ webpack-dev-server --open
  52. Project is running at http://app.dev/
  53. webpack output is served from http://localhost:8080/assets/
  54. Content not from webpack is served from /Users/hendrik/Documents/Github/Projects/app/src....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement