Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- npm install waypoints
- import waypoint from 'waypoints';
- var webpack = require('webpack');
- var path = require('path');
- let ExtractTextPlugin = require("extract-text-webpack-plugin");
- var WebpackNotifierPlugin = require('webpack-notifier');
- var fs = require('file-system');
- var CleanWebpackPlugin = require('clean-webpack-plugin');
- module.exports = {
- /*node: {
- fs: "empty"
- },*/
- resolve: {
- alias: {
- 'masonry': 'masonry-layout',
- 'isotope': 'isotope-layout'
- }
- },
- entry: './main.js',
- devtool: 'source-map',
- output: {
- path: path.resolve(__dirname, './public/assets'),
- filename: 'bundle.[chunkhash].js',
- },
- module: {
- rules: [
- { test: /.js$/,
- exclude: /node_modules/,
- loader: "babel-loader?presets[]=es2015",
- },
- {
- test:/.scss$/,
- use: ExtractTextPlugin.extract({
- use: [{loader:'css-loader?sourceMap'}, {loader:'sass-loader', options: {
- sourceMap: true,
- }}],
- })
- },
- {
- test: /.vue$/,
- loader: 'vue-loader',
- options: {
- loaders: {
- }
- // other vue-loader options go here
- }
- },
- ]
- },
- plugins: [
- new CleanWebpackPlugin(['assets/*', 'css/*'], {
- root: '/Users/LEITH/sites/laravelleith/public',
- verbose: true,
- dry: false,
- exclude: ['360lockturret.jpg'],
- watch: true
- }),
- new webpack.optimize.UglifyJsPlugin(),
- new ExtractTextPlugin('app.[chunkhash].css'),
- new WebpackNotifierPlugin(),
- function() {
- this.plugin('done', stats =>{
- fs.writeFileSync(
- path.join(__dirname, 'manifest.json'),
- JSON.stringify(stats.toJson().assetsByChunkName)
- )
- });
- }
- ]
- };
- import 'waypoints/lib/noframework.waypoints.min.js';
- const waypoint = new Waypoint({
- element: document.getElementById('myScrollTarget'),
- handler: () => {}
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement