Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

302
Visualizações
Trying to load a webpack generated file in other app is not working

I created a simple vue project using vue create . and default settings for vue2.

//vue.config.js
module.exports = {
    configureWebpack: {
        entry: {
            mvcapp: [
                './src/main-mvc.ts',
            ],
        },
    },
};

I have a simple code

// main-mvc.js
console.log('hello from mvc');

Now when running yarn serve its loading the app and showing the message in console. Till thats its fine.

Now I have another app (simple-app), in which there is sample.html file containing code

<script src="http://localhost:8080/js/mvcapp.js"></script>

While the vue project running, I also started the simple-app using the live-server. Loading the sample.html in browser is loading the main.mvc.js file without any error, but there is no console message.

Can someone point me whats wrong here? Why the main-mvc.js file is not running the code correctly if linked in some other app?

Here is the full code of the generated js: https://goonlinetools.com/snapshot/code/#txgbtna5tas75m4ctl3jud

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda