diff --git a/apps/fabric-website/README.md b/apps/fabric-website/README.md index 07dc1eb7fadc06..ef9837f03caab9 100644 --- a/apps/fabric-website/README.md +++ b/apps/fabric-website/README.md @@ -8,19 +8,26 @@ Office UI Fabric is a collection of projects that represent the Office and Offic Before you get started, make sure you have [node.js](https://nodejs.org/), [gulp](http://gulpjs.com/), and [git](https://git-scm.com/) installed. To view the documentation including examples, contracts, current statuses, and to add functionality or fix issues locally, you can: -1. `git clone https://github.com/OfficeDev/office-ui-fabric-react.git` - this is the [Office UI Fabric React project](https://github.com/OfficeDev/office-ui-fabric-react) which you will want to name *office-ui-fabric-react* -2. `npm install` the Fabric React project you just cloned in the previous step. -3. In the command prompt change directories to the fabric-website director in apps `cd apps/fabric-website/`. -4. Then to start the website run `npm start`. This will open your operating system's default web browser with the website. You can make changes to the code which will automatically build and refresh the page using live-reload. +1. `git clone https://github.com/OfficeDev/office-ui-fabric-react.git` - this is the [Office UI Fabric React project](https://github.com/OfficeDev/office-ui-fabric-react) which you will want to name _office-ui-fabric-react_ +2. `npm install` the Fabric React project you just cloned in the previous step. +3. In the command prompt change directories to the fabric-website director in apps `cd apps/fabric-website/`. +4. Then to start the website run `npm start`. This will open your operating system's default web browser with the website. You can make changes to the code which will automatically build and refresh the page using live-reload. **Note**: Were any steps missing? Could the instructions be made clearer for the next person? Update the instructions above and submit a pull request! +## Test serving minified files locally + +1. `npm install -g http-server` +2. In the fabric-website directory, run `npm run production` to build your minified files. They should be in the dist folder. +3. `index.html` has logic to check if the app is running locally to serve the proper files. +4. In the same directory, run `http-server`. This should serve the website for you to test as it runs on your new minified files. + ## Licenses All files on the Office UI Fabric React GitHub repository are subject to the MIT license. Please read the License file at the root of the project. Usage of the fonts referenced in Office UI Fabric files is subject to the [license](https://spoprod-a.akamaihd.net/files/fabric/assets/microsoft_fabric_assets_license_agreement_10262017.pdf). -- - - +--- -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. \ No newline at end of file +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. diff --git a/apps/fabric-website/index.html b/apps/fabric-website/index.html index 9d6ea18b80e524..4a2681f2d24a96 100644 --- a/apps/fabric-website/index.html +++ b/apps/fabric-website/index.html @@ -44,10 +44,14 @@ } } + var isLocal = window.location.hostname === 'localhost'; + // This path allows minified files to be served locally for testing purposes. + var appPath = isLocal ? './dist/' : ''; + var scripts = [ '//cdnjs.cloudflare.com/ajax/libs/react/16.3.1/umd/react.production.min.js', '//cdnjs.cloudflare.com/ajax/libs/react-dom/16.3.1/umd/react-dom.production.min.js', - '/fabric-sitev5.js' + appPath + '/fabric-sitev5.js' ]; loadScript(scripts); diff --git a/common/changes/@uifabric/fabric-website/fix-sideeffects_2018-06-07-18-48.json b/common/changes/@uifabric/fabric-website/fix-sideeffects_2018-06-07-18-48.json new file mode 100644 index 00000000000000..af434081299e81 --- /dev/null +++ b/common/changes/@uifabric/fabric-website/fix-sideeffects_2018-06-07-18-48.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "@uifabric/fabric-website", + "comment": "Add documentation for testing minified files locally.", + "type": "patch" + } + ], + "packageName": "@uifabric/fabric-website", + "email": "lynam.emily@gmail.com" +} \ No newline at end of file diff --git a/common/changes/office-ui-fabric-react/fix-sideeffects_2018-06-07-18-48.json b/common/changes/office-ui-fabric-react/fix-sideeffects_2018-06-07-18-48.json new file mode 100644 index 00000000000000..e62915b47de84e --- /dev/null +++ b/common/changes/office-ui-fabric-react/fix-sideeffects_2018-06-07-18-48.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "office-ui-fabric-react", + "comment": "Package: Fix sideEffects array to target scss files using global.", + "type": "patch" + } + ], + "packageName": "office-ui-fabric-react", + "email": "lynam.emily@gmail.com" +} \ No newline at end of file diff --git a/packages/office-ui-fabric-react/package.json b/packages/office-ui-fabric-react/package.json index 739667fe387cee..0f5dbc22136ed2 100644 --- a/packages/office-ui-fabric-react/package.json +++ b/packages/office-ui-fabric-react/package.json @@ -5,9 +5,9 @@ "main": "lib-commonjs/index.js", "module": "lib/index.js", "sideEffects": [ - "*.global.js", - "*Examples.js", - "*Example.js" + "*.global.*", + "*Examples.*", + "*Example.*" ], "typings": "lib/index.d.ts", "repository": {