[Vuejs]-How do I add an external .js file to my index.html? (VueJS2)

0๐Ÿ‘

You can add another entry point and give it a name using webpack chain in your vue.config.js. This will automagically be inserted in your index.html file:

// vue.config.js

module.exports = {
  chainWebpack: (config) => {
    config
      .entry('delaunay')
      .add('src/assets/delaunay.js')
      .end()
  }
}

This should work for you in practice.

0๐Ÿ‘

in your js file you can do this:

import delaunay from './src/assets/delaunay.js'
import bg from './src/assets/bg.js'

Leave a comment