[Vuejs]-Vue bundle not executed when injected via script

0๐Ÿ‘

โœ…

So I figured it out. This embed worked fine on other websites, but had issues on websites that also used a webpack bundle. The fix for me was to set a different jsonpFunction value in the webpack config.

vue.config.js

module.exports = {
    publicPath: (process.env.NODE_ENV === 'production') ? 'https://test.com/' : '/',
    filenameHashing: false,
    css: {
        extract: false,
    },
    chainWebpack(config) {
        config.optimization.delete('splitChunks')
        config.plugins.delete('prefetch')
        config.output.set('jsonpFunction', 'customWebpackJsonp')
    },
}

Leave a comment