Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. npm install waypoints
  2.  
  3. import waypoint from 'waypoints';
  4.  
  5. var webpack = require('webpack');
  6. var path = require('path');
  7. let ExtractTextPlugin = require("extract-text-webpack-plugin");
  8. var WebpackNotifierPlugin = require('webpack-notifier');
  9. var fs = require('file-system');
  10. var CleanWebpackPlugin = require('clean-webpack-plugin');
  11.  
  12.  
  13. module.exports = {
  14. /*node: {
  15. fs: "empty"
  16. },*/
  17. resolve: {
  18. alias: {
  19. 'masonry': 'masonry-layout',
  20. 'isotope': 'isotope-layout'
  21. }
  22. },
  23.  
  24. entry: './main.js',
  25. devtool: 'source-map',
  26. output: {
  27. path: path.resolve(__dirname, './public/assets'),
  28. filename: 'bundle.[chunkhash].js',
  29. },
  30.  
  31. module: {
  32. rules: [
  33.  
  34. { test: /.js$/,
  35. exclude: /node_modules/,
  36. loader: "babel-loader?presets[]=es2015",
  37.  
  38. },
  39.  
  40. {
  41. test:/.scss$/,
  42. use: ExtractTextPlugin.extract({
  43. use: [{loader:'css-loader?sourceMap'}, {loader:'sass-loader', options: {
  44. sourceMap: true,
  45.  
  46. }}],
  47.  
  48. })
  49. },
  50.  
  51.  
  52.  
  53. {
  54. test: /.vue$/,
  55. loader: 'vue-loader',
  56. options: {
  57. loaders: {
  58. }
  59. // other vue-loader options go here
  60. }
  61. },
  62.  
  63.  
  64.  
  65. ]
  66. },
  67.  
  68. plugins: [
  69. new CleanWebpackPlugin(['assets/*', 'css/*'], {
  70. root: '/Users/LEITH/sites/laravelleith/public',
  71. verbose: true,
  72. dry: false,
  73. exclude: ['360lockturret.jpg'],
  74. watch: true
  75. }),
  76.  
  77. new webpack.optimize.UglifyJsPlugin(),
  78. new ExtractTextPlugin('app.[chunkhash].css'),
  79. new WebpackNotifierPlugin(),
  80.  
  81. function() {
  82. this.plugin('done', stats =>{
  83. fs.writeFileSync(
  84. path.join(__dirname, 'manifest.json'),
  85. JSON.stringify(stats.toJson().assetsByChunkName)
  86. )
  87.  
  88. });
  89. }
  90.  
  91. ]
  92.  
  93. };
  94.  
  95. import 'waypoints/lib/noframework.waypoints.min.js';
  96.  
  97. const waypoint = new Waypoint({
  98. element: document.getElementById('myScrollTarget'),
  99. handler: () => {}
  100. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement