AngularJS and Webpack Integration

前端 未结 2 1446
生来不讨喜
生来不讨喜 2021-02-08 22:32

I am looking for some help with using webpack for a large AngularJS application. We are using folder structure based on feature (each feature/page has a module and they have con

2条回答
  •  长发绾君心
    2021-02-08 23:15

    This is a quote from https://github.com/webpack/webpack/issues/150

    webpack is a module bundler not a javascript loader. It package files from local disk and don't load files from the web (except its own chunks).

    Use a javascript loader, i. e. script.js

    var $script = require("scriptjs");
    $script("//ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular.min.js", function() {
      // ...
    });
    

提交回复
热议问题