vue.js - Adding external library to vuejs -


i new web development scene , started dive it, still getting hang on how stuff wired in background process webpack.

i trying wow.js installed npm work in vue components. wondering how include wow.js globally, such future vue component able use wow?

i included following in index.html, didn't work.

<script src="node_modules/wowjs/dist/wow.min.js"></script><script>new wow().init();</script>>   

but when following, fetches cdn, works.

<script src="//cdnjs.cloudflare.com/ajax/libs/wow/0.1.12/wow.min.js"></script><script>new wow().init();</script>> 

although works if use cdn method, want find out proper way include npm installed dependencies

webpack.base.config

var path = require('path') var utils = require('./utils') var config = require('../config') var vueloaderconfig = require('./vue-loader.conf')  function resolve (dir) {   return path.join(__dirname, '..', dir) }  module.exports = {   entry: {     app: './src/main.js'   },   output: {     path: config.build.assetsroot,     filename: '[name].js',     publicpath: process.env.node_env === 'production'       ? config.build.assetspublicpath       : config.dev.assetspublicpath   },   resolve: {     extensions: ['.js', '.vue', '.json'],     alias: {       'vue$': 'vue/dist/vue.esm.js',       '@': resolve('src')     }   },   module: {     rules: [       {         test: /\.(js|vue)$/,         loader: 'eslint-loader',         enforce: 'pre',         include: [resolve('src'), resolve('test')],         options: {           formatter: require('eslint-friendly-formatter')         }       },       {         test: /\.vue$/,         loader: 'vue-loader',         options: vueloaderconfig       },       {         test: /\.js$/,         loader: 'babel-loader',         include: [resolve('src'), resolve('test')]       },       {         test: /\.styl$/,         loader: ['style-loader', 'css-loader', 'stylus-loader']       },       {         test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,         loader: 'url-loader',         options: {           limit: 10000,           name: utils.assetspath('img/[name].[hash:7].[ext]')         }       },       {         test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,         loader: 'url-loader',         options: {           limit: 10000,           name: utils.assetspath('fonts/[name].[hash:7].[ext]')         }       }     ]   } } 


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -