Our team has embarked on developing an application and we've decided to integrate it with office-ui-fabric-react. While I am familiar with installing packages using npm, I am unsure about where to install both NodeJs & gulp.
I have a repository named Relationize, within which there are folders for my Api and web application (along with my package-lock.json).
I'm not sure if these installations should go in the root where my project file is located or in my wwwroot directory (some sources mention it should be in the root). However, when I executed all three commands: npm i -S nodejs
, npm install --global gulp-cli
, and finally
npm --save install office-ui-fabric-react
to install the office package.
When attempting to add a component in a separate JavaScript file just to test its functionality (by copying code from @Microsoft):
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Fabric } from 'office-ui-fabric-react/lib/Fabric';
import { DefaultButton } from 'office-ui-fabric-react/lib/Button';
const MyPage = () => (<Fabric><DefaultButton>I am a button.</DefaultButton></Fabric>);
ReactDOM.render(<MyPage />, document.body.firstChild);
An error is thrown:
Uncaught SyntaxError: Unexpected token import
If anyone has a clear guide on how to implement this in an existing project or is willing to assist me through the process, your help would be greatly appreciated!
Thank you in advance!