joeldenning / simple-single-spa-webpack-example

A simple example of how to use webpack with single-spa
MIT License
294 stars 95 forks source link

Webpack support with Angular 1.4 code #33

Closed ajaykumarsana closed 4 years ago

ajaykumarsana commented 4 years ago

HI @joeldenning ,

I'm using Angular 1.4 code( ES5 ) , using webpack as build tool. 'm not able to export bootstrap, unmount and mount functions. Here is my code which is in entry file.

var jsSingle = require('single-spa-angularjs');
var angular = require('angular');
var ngLifecycles = jsSingle.default({
  angular: angular,
  mainAngularModule: 'emp',
  uiRouter: true,
  preserveGlobal: false,
});

var bootstrap = ngLifecycles.bootstrap;
var mount = ngLifecycles.mount;
var unmount = ngLifecycles.unmount;

How do i export those bootstrap, unmount and mount functions?

please help.

ajaykumarsana commented 4 years ago

Hi @joeldenning , Please help. Thank you.

joeldenning commented 4 years ago

With webpack, you can export via the export keyword. See documentation at https://single-spa.js.org/docs/ecosystem-angularjs#with-a-bundler. Closing this because I've answered the question, but feel free to comment further or reopen.