-1

In documentation under the "Use via NPM (es6 modules)" section you show some snippets on how to use the library via script tags. Does that require any bundlers like webpack?

Could you provide a full example (via zip file, jsfiddle or codesandbox)?

I'm especially interested in a single component import.

Thanks!

Eugene Kulabuhov
  • 2,349
  • 1
  • 26
  • 25

1 Answers1

0

Correct, you can use any bundler with our npm package and only import the components you need. For example, if you want to only use the person component, you can only import it's entry point and let the bundler handle the tree shaking.

ex: install the npm package

npm install '@microsoft/mgt'

Import just the person component in your code

import '@microsoft/mgt/dist/es6/components/mgt-person/mgt-person';

You can now use <mgt-person>.

Nikola Metulev
  • 566
  • 3
  • 7