Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!