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

230
Visualizações
angular.module is not function in webpack

I am beginner for learn angular and webpack, I using node command prompt to run angular in webpack, I am just given angular.min.js link in app.js file but the bundle.js not accept the anguar.module(), it is says angular.module is not a function, please help me to achieve this

var angular = require('../node_modules/angular/angular.js');
var ngModule = angular.module('app',[]);
console.log(ngModule);
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

WebPack will load modules directly from node_modules without having to be configured to do so. You just need to add them as entry points in the config.

webpack.config.js

entry: {
    vendor: ['angular'],
    app: './src/app.js'
}

You can add other modules like lodash or jquery this way as well.

Now in your code you can use angular like this

import angular from 'angular';

export default angular.module('app',[]);

You can then import the module in other JS files like this.

import app from './app.js';

app.directive('myWidget',.....);
over 4 years ago · Santiago Trujillo Relatório
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