include third party library in webpack
<p>I am trying to include a plugin (<a href="https://github.com/ctrl-freaks/freezeframe.js#advanced_usage" rel="nofollow noreferrer">freezeframe plugin</a>) into my app using webpack but am not able to understand how to do it. I am serving this file locally from my app and not from a cdn or npm/bower. I've searched all over to try and work this out but haven't been able to get close.</p>

<p>my webpack file looks like this:</p>

<pre><code>const webpack = require('webpack');
const conf = require('./gulp.conf');
const path = require('path');

const HtmlWebpackPlugin = require('html-webpack-plugin');
const autoprefixer = require('autoprefixer');

module.exports = {
  module: {
    preLoaders: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'eslint'
      }
    ],

    loaders: [
      {
        test: /.json$/,
        loaders: [
          'json'
        ]
      },
      {
        test: /\.gif$/,
        loader: 'url-loader',
        query: { mimetype: 'image/gif' }
      },
      {
        test: /\.svg$/,
        loader: 'svg-loader?pngScale=2'
      },
      {
        test: /\.(eot|woff|woff2|ttf|svg|png|jpg)$/,
        loader: 'url-loader?limit=30000&amp;name=[name]-[hash].[ext]'
      },
      {
        test: /\.(css|scss)$/,
        loaders: [
          'style',
          'css',
          'sass',
          'postcss'
        ]
      },
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loaders: [
          'babel',
        ]
      },
      {
        test: /.vue$/,
        loaders: [
          'vue'
        ]
      }
    ]
  },
  vue: {
    postcss: [
      require('autoprefixer')({
        browsers: [
          'Android &gt;= 2.3',
          'BlackBerry &gt;= 7',
          'Chrome &gt;= 9',
          'Firefox &gt;= 4',
          'Explorer &gt;= 9',
          'iOS &gt;= 5',
          'Opera &gt;= 11',
          'Safari &gt;= 5',
          'OperaMobile &gt;= 11',
          'OperaMini &gt;= 6',
          'ChromeAndroid &gt;= 9',
          'FirefoxAndroid &gt;= 4',
          'ExplorerMobile &gt;= 9'
        ]
      }),
    ]
  },
  plugins: [
    new webpack.optimize.OccurrenceOrderPlugin(),
    new webpack.NoErrorsPlugin(),
    new HtmlWebpackPlugin({
      template: conf.path.src('index.html')
    }),
    new webpack.ProvidePlugin({
      $: 'jquery',
      jquery: 'jquery',
      'window.jQuery': 'jquery',
      jQuery: 'jquery',
      slick: 'slick-carousel'
    })
  ],
  resolve: {
    extensions: ['', '.js', '.css', '.scss'],
    alias: {
      'jQuery': path.join(__dirname, 'node_modules', 'jquery', 'dist', 'jquery')
    }
  },
  postcss: () =&gt; [autoprefixer({
    browsers: [
      'Android &gt;= 2.3',
      'BlackBerry &gt;= 7',
      'Chrome &gt;= 9',
      'Firefox &gt;= 4',
      'Explorer &gt;= 9',
      'iOS &gt;= 5',
      'Opera &gt;= 11',
      'Safari &gt;= 5',
      'OperaMobile &gt;= 11',
      'OperaMini &gt;= 6',
      'ChromeAndroid &gt;= 9',
      'FirefoxAndroid &gt;= 4',
      'ExplorerMobile &gt;= 9'
    ]
  })],
  debug: true,
  devtool: 'source-map',
  output: {
    path: path.join(process.cwd(), conf.paths.tmp),
    filename: 'index.js'
  },
  entry: `./${conf.path.src('index')}`
};
</code></pre>

<p>I thought I write <code>require('./assets/freezeframe/freezeframe.js');</code> in my vue component but it then complains of jquery isn't defined. I have jquery installed via npm and I am already using another plugin that does use jquery like this:</p>

<pre><code>import 'slick-carousel';
  const imagesLoaded = require('imagesloaded');

  export default {
    name: 'Slider',
    props: ['images', 'component'],
    mounted () {
      var that = this;
      $(function() {
        imagesLoaded('.js-component-slider',() =&gt; {
          $(that.$el).slick({
            adaptiveHeight: true,
            infinite: false
          });
        });
      });
    }
  }
</code></pre>

<p>I am now not sure what to do. I don't want to just include another jquery and the plugin file at the top/bottom of my index.html because I want it bundled together.</p>

<p>The only other painful thing is this plugin isnt in npm and im not using bower.</p>

<p><strong>UPDATE:</strong></p>

<p>I have seen this question <a href="https://stackoverflow.com/questions/34182732/how-to-import-js-script-in-vue-loader-component">add-js-file</a> but i've tried doing that to the plugin but still get an error of it not being included when i require('nameoffile')</p>