diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index f614dcbe..2f151e2e 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -23,7 +23,7 @@ jobs:
if_true: false
if_false: true
- name: Checkout repository
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
submodules: 'recursive'
diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml
new file mode 100644
index 00000000..5f5d4520
--- /dev/null
+++ b/.github/workflows/prettier.yml
@@ -0,0 +1,20 @@
+name: Lint Frontend
+on:
+ push:
+
+jobs:
+ lint:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ submodules: 'recursive'
+ - name: Restore npm dependencies
+ working-directory: Parlance.ClientApp
+ run: |
+ npm ci
+ - name: Lint
+ working-directory: Parlance.ClientApp
+ run: |
+ npm run lint
\ No newline at end of file
diff --git a/Parlance.ClientApp/.prettierignore b/Parlance.ClientApp/.prettierignore
new file mode 100644
index 00000000..42e57c72
--- /dev/null
+++ b/Parlance.ClientApp/.prettierignore
@@ -0,0 +1,3 @@
+dist
+obj
+public/resources/translations
diff --git a/Parlance.ClientApp/.prettierrc b/Parlance.ClientApp/.prettierrc
new file mode 100644
index 00000000..0156c36e
--- /dev/null
+++ b/Parlance.ClientApp/.prettierrc
@@ -0,0 +1,4 @@
+{
+ "arrowParens": "avoid",
+ "endOfLine": "auto"
+}
diff --git a/Parlance.ClientApp/README.md b/Parlance.ClientApp/README.md
index c56022ee..d566f80d 100644
--- a/Parlance.ClientApp/README.md
+++ b/Parlance.ClientApp/README.md
@@ -7,102 +7,102 @@ guide [here](https://github.com/facebookincubator/create-react-app/blob/master/p
## Table of Contents
-- [Updating to New Releases](#updating-to-new-releases)
-- [Sending Feedback](#sending-feedback)
-- [Folder Structure](#folder-structure)
-- [Available Scripts](#available-scripts)
- - [npm start](#npm-start)
- - [npm test](#npm-test)
- - [npm run build](#npm-run-build)
- - [npm run eject](#npm-run-eject)
-- [Supported Language Features and Polyfills](#supported-language-features-and-polyfills)
-- [Syntax Highlighting in the Editor](#syntax-highlighting-in-the-editor)
-- [Displaying Lint Output in the Editor](#displaying-lint-output-in-the-editor)
-- [Debugging in the Editor](#debugging-in-the-editor)
-- [Formatting Code Automatically](#formatting-code-automatically)
-- [Changing the Page `
`](#changing-the-page-title)
-- [Installing a Dependency](#installing-a-dependency)
-- [Importing a Component](#importing-a-component)
-- [Code Splitting](#code-splitting)
-- [Adding a Stylesheet](#adding-a-stylesheet)
-- [Post-Processing CSS](#post-processing-css)
-- [Adding a CSS Preprocessor (Sass, Less etc.)](#adding-a-css-preprocessor-sass-less-etc)
-- [Adding Images, Fonts, and Files](#adding-images-fonts-and-files)
-- [Using the `public` Folder](#using-the-public-folder)
- - [Changing the HTML](#changing-the-html)
- - [Adding Assets Outside of the Module System](#adding-assets-outside-of-the-module-system)
- - [When to Use the `public` Folder](#when-to-use-the-public-folder)
-- [Using Global Variables](#using-global-variables)
-- [Adding Bootstrap](#adding-bootstrap)
- - [Using a Custom Theme](#using-a-custom-theme)
-- [Adding Flow](#adding-flow)
-- [Adding Custom Environment Variables](#adding-custom-environment-variables)
- - [Referencing Environment Variables in the HTML](#referencing-environment-variables-in-the-html)
- - [Adding Temporary Environment Variables In Your Shell](#adding-temporary-environment-variables-in-your-shell)
- - [Adding Development Environment Variables In `.env`](#adding-development-environment-variables-in-env)
-- [Can I Use Decorators?](#can-i-use-decorators)
-- [Integrating with an API Backend](#integrating-with-an-api-backend)
- - [Node](#node)
- - [Ruby on Rails](#ruby-on-rails)
-- [Proxying API Requests in Development](#proxying-api-requests-in-development)
- - ["Invalid Host Header" Errors After Configuring Proxy](#invalid-host-header-errors-after-configuring-proxy)
- - [Configuring the Proxy Manually](#configuring-the-proxy-manually)
- - [Configuring a WebSocket Proxy](#configuring-a-websocket-proxy)
-- [Using HTTPS in Development](#using-https-in-development)
-- [Generating Dynamic `` Tags on the Server](#generating-dynamic-meta-tags-on-the-server)
-- [Pre-Rendering into Static HTML Files](#pre-rendering-into-static-html-files)
-- [Injecting Data from the Server into the Page](#injecting-data-from-the-server-into-the-page)
-- [Running Tests](#running-tests)
- - [Filename Conventions](#filename-conventions)
- - [Command Line Interface](#command-line-interface)
- - [Version Control Integration](#version-control-integration)
- - [Writing Tests](#writing-tests)
- - [Testing Components](#testing-components)
- - [Using Third Party Assertion Libraries](#using-third-party-assertion-libraries)
- - [Initializing Test Environment](#initializing-test-environment)
- - [Focusing and Excluding Tests](#focusing-and-excluding-tests)
- - [Coverage Reporting](#coverage-reporting)
- - [Continuous Integration](#continuous-integration)
- - [Disabling jsdom](#disabling-jsdom)
- - [Snapshot Testing](#snapshot-testing)
- - [Editor Integration](#editor-integration)
-- [Developing Components in Isolation](#developing-components-in-isolation)
- - [Getting Started with Storybook](#getting-started-with-storybook)
- - [Getting Started with Styleguidist](#getting-started-with-styleguidist)
-- [Making a Progressive Web App](#making-a-progressive-web-app)
- - [Opting Out of Caching](#opting-out-of-caching)
- - [Offline-First Considerations](#offline-first-considerations)
- - [Progressive Web App Metadata](#progressive-web-app-metadata)
-- [Analyzing the Bundle Size](#analyzing-the-bundle-size)
-- [Deployment](#deployment)
- - [Static Server](#static-server)
- - [Other Solutions](#other-solutions)
- - [Serving Apps with Client-Side Routing](#serving-apps-with-client-side-routing)
- - [Building for Relative Paths](#building-for-relative-paths)
- - [Azure](#azure)
- - [Firebase](#firebase)
- - [GitHub Pages](#github-pages)
- - [Heroku](#heroku)
- - [Netlify](#netlify)
- - [Now](#now)
- - [S3 and CloudFront](#s3-and-cloudfront)
- - [Surge](#surge)
-- [Advanced Configuration](#advanced-configuration)
-- [Troubleshooting](#troubleshooting)
- - [`npm start` doesn’t detect changes](#npm-start-doesnt-detect-changes)
- - [`npm test` hangs on macOS Sierra](#npm-test-hangs-on-macos-sierra)
- - [`npm run build` exits too early](#npm-run-build-exits-too-early)
- - [`npm run build` fails on Heroku](#npm-run-build-fails-on-heroku)
- - [`npm run build` fails to minify](#npm-run-build-fails-to-minify)
- - [Moment.js locales are missing](#momentjs-locales-are-missing)
-- [Something Missing?](#something-missing)
+- [Updating to New Releases](#updating-to-new-releases)
+- [Sending Feedback](#sending-feedback)
+- [Folder Structure](#folder-structure)
+- [Available Scripts](#available-scripts)
+ - [npm start](#npm-start)
+ - [npm test](#npm-test)
+ - [npm run build](#npm-run-build)
+ - [npm run eject](#npm-run-eject)
+- [Supported Language Features and Polyfills](#supported-language-features-and-polyfills)
+- [Syntax Highlighting in the Editor](#syntax-highlighting-in-the-editor)
+- [Displaying Lint Output in the Editor](#displaying-lint-output-in-the-editor)
+- [Debugging in the Editor](#debugging-in-the-editor)
+- [Formatting Code Automatically](#formatting-code-automatically)
+- [Changing the Page ``](#changing-the-page-title)
+- [Installing a Dependency](#installing-a-dependency)
+- [Importing a Component](#importing-a-component)
+- [Code Splitting](#code-splitting)
+- [Adding a Stylesheet](#adding-a-stylesheet)
+- [Post-Processing CSS](#post-processing-css)
+- [Adding a CSS Preprocessor (Sass, Less etc.)](#adding-a-css-preprocessor-sass-less-etc)
+- [Adding Images, Fonts, and Files](#adding-images-fonts-and-files)
+- [Using the `public` Folder](#using-the-public-folder)
+ - [Changing the HTML](#changing-the-html)
+ - [Adding Assets Outside of the Module System](#adding-assets-outside-of-the-module-system)
+ - [When to Use the `public` Folder](#when-to-use-the-public-folder)
+- [Using Global Variables](#using-global-variables)
+- [Adding Bootstrap](#adding-bootstrap)
+ - [Using a Custom Theme](#using-a-custom-theme)
+- [Adding Flow](#adding-flow)
+- [Adding Custom Environment Variables](#adding-custom-environment-variables)
+ - [Referencing Environment Variables in the HTML](#referencing-environment-variables-in-the-html)
+ - [Adding Temporary Environment Variables In Your Shell](#adding-temporary-environment-variables-in-your-shell)
+ - [Adding Development Environment Variables In `.env`](#adding-development-environment-variables-in-env)
+- [Can I Use Decorators?](#can-i-use-decorators)
+- [Integrating with an API Backend](#integrating-with-an-api-backend)
+ - [Node](#node)
+ - [Ruby on Rails](#ruby-on-rails)
+- [Proxying API Requests in Development](#proxying-api-requests-in-development)
+ - ["Invalid Host Header" Errors After Configuring Proxy](#invalid-host-header-errors-after-configuring-proxy)
+ - [Configuring the Proxy Manually](#configuring-the-proxy-manually)
+ - [Configuring a WebSocket Proxy](#configuring-a-websocket-proxy)
+- [Using HTTPS in Development](#using-https-in-development)
+- [Generating Dynamic `` Tags on the Server](#generating-dynamic-meta-tags-on-the-server)
+- [Pre-Rendering into Static HTML Files](#pre-rendering-into-static-html-files)
+- [Injecting Data from the Server into the Page](#injecting-data-from-the-server-into-the-page)
+- [Running Tests](#running-tests)
+ - [Filename Conventions](#filename-conventions)
+ - [Command Line Interface](#command-line-interface)
+ - [Version Control Integration](#version-control-integration)
+ - [Writing Tests](#writing-tests)
+ - [Testing Components](#testing-components)
+ - [Using Third Party Assertion Libraries](#using-third-party-assertion-libraries)
+ - [Initializing Test Environment](#initializing-test-environment)
+ - [Focusing and Excluding Tests](#focusing-and-excluding-tests)
+ - [Coverage Reporting](#coverage-reporting)
+ - [Continuous Integration](#continuous-integration)
+ - [Disabling jsdom](#disabling-jsdom)
+ - [Snapshot Testing](#snapshot-testing)
+ - [Editor Integration](#editor-integration)
+- [Developing Components in Isolation](#developing-components-in-isolation)
+ - [Getting Started with Storybook](#getting-started-with-storybook)
+ - [Getting Started with Styleguidist](#getting-started-with-styleguidist)
+- [Making a Progressive Web App](#making-a-progressive-web-app)
+ - [Opting Out of Caching](#opting-out-of-caching)
+ - [Offline-First Considerations](#offline-first-considerations)
+ - [Progressive Web App Metadata](#progressive-web-app-metadata)
+- [Analyzing the Bundle Size](#analyzing-the-bundle-size)
+- [Deployment](#deployment)
+ - [Static Server](#static-server)
+ - [Other Solutions](#other-solutions)
+ - [Serving Apps with Client-Side Routing](#serving-apps-with-client-side-routing)
+ - [Building for Relative Paths](#building-for-relative-paths)
+ - [Azure](#azure)
+ - [Firebase](#firebase)
+ - [GitHub Pages](#github-pages)
+ - [Heroku](#heroku)
+ - [Netlify](#netlify)
+ - [Now](#now)
+ - [S3 and CloudFront](#s3-and-cloudfront)
+ - [Surge](#surge)
+- [Advanced Configuration](#advanced-configuration)
+- [Troubleshooting](#troubleshooting)
+ - [`npm start` doesn’t detect changes](#npm-start-doesnt-detect-changes)
+ - [`npm test` hangs on macOS Sierra](#npm-test-hangs-on-macos-sierra)
+ - [`npm run build` exits too early](#npm-run-build-exits-too-early)
+ - [`npm run build` fails on Heroku](#npm-run-build-fails-on-heroku)
+ - [`npm run build` fails to minify](#npm-run-build-fails-to-minify)
+ - [Moment.js locales are missing](#momentjs-locales-are-missing)
+- [Something Missing?](#something-missing)
## Updating to New Releases
Create React App is divided into two packages:
-* `create-react-app` is a global command-line utility that you use to create new projects.
-* `react-scripts` is a development dependency in the generated projects (including this one).
+- `create-react-app` is a global command-line utility that you use to create new projects.
+- `react-scripts` is a development dependency in the generated projects (including this one).
You almost never need to update `create-react-app` itself: it delegates all the setup to `react-scripts`.
@@ -148,8 +148,8 @@ my-app/
For the project to build, **these files must exist with exact filenames**:
-* `public/index.html` is the page template;
-* `src/index.js` is the JavaScript entry point.
+- `public/index.html` is the page template;
+- `src/index.js` is the JavaScript entry point.
You can delete or rename the other files.
@@ -209,12 +209,12 @@ customize it when you are ready for it.
This project supports a superset of the latest JavaScript standard.
In addition to [ES6](https://github.com/lukehoban/es6features) syntax features, it also supports:
-* [Exponentiation Operator](https://github.com/rwaldron/exponentiation-operator) (ES2016).
-* [Async/await](https://github.com/tc39/ecmascript-asyncawait) (ES2017).
-* [Object Rest/Spread Properties](https://github.com/sebmarkbage/ecmascript-rest-spread) (stage 3 proposal).
-* [Dynamic import()](https://github.com/tc39/proposal-dynamic-import) (stage 3 proposal)
-* [Class Fields and Static Properties](https://github.com/tc39/proposal-class-public-fields) (part of stage 3 proposal).
-* [JSX](https://facebook.github.io/react/docs/introducing-jsx.html) and [Flow](https://flowtype.org/) syntax.
+- [Exponentiation Operator](https://github.com/rwaldron/exponentiation-operator) (ES2016).
+- [Async/await](https://github.com/tc39/ecmascript-asyncawait) (ES2017).
+- [Object Rest/Spread Properties](https://github.com/sebmarkbage/ecmascript-rest-spread) (stage 3 proposal).
+- [Dynamic import()](https://github.com/tc39/proposal-dynamic-import) (stage 3 proposal)
+- [Class Fields and Static Properties](https://github.com/tc39/proposal-class-public-fields) (part of stage 3 proposal).
+- [JSX](https://facebook.github.io/react/docs/introducing-jsx.html) and [Flow](https://flowtype.org/) syntax.
Learn more about [different proposal stages](https://babeljs.io/docs/plugins/#presets-stage-x-experimental-presets-).
@@ -224,12 +224,12 @@ of these proposals change in the future.
Note that **the project only includes a few ES6 [polyfills](https://en.wikipedia.org/wiki/Polyfill)**:
-* [`Object.assign()`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
- via [`object-assign`](https://github.com/sindresorhus/object-assign).
-* [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
- via [`promise`](https://github.com/then/promise).
-* [`fetch()`](https://developer.mozilla.org/en/docs/Web/API/Fetch_API)
- via [`whatwg-fetch`](https://github.com/github/fetch).
+- [`Object.assign()`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
+ via [`object-assign`](https://github.com/sindresorhus/object-assign).
+- [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
+ via [`promise`](https://github.com/then/promise).
+- [`fetch()`](https://developer.mozilla.org/en/docs/Web/API/Fetch_API)
+ via [`whatwg-fetch`](https://github.com/github/fetch).
If you use any other ES6+ features that need **runtime support** (such as `Array.from()` or `Symbol`), make sure you are
including the appropriate polyfills manually, or that the browsers you are targeting already support them.
@@ -287,17 +287,19 @@ Then add the block below to your `launch.json` file and put it inside the `.vsco
```json
{
- "version": "0.2.0",
- "configurations": [{
- "name": "Chrome",
- "type": "chrome",
- "request": "launch",
- "url": "http://localhost:3000",
- "webRoot": "${workspaceRoot}/src",
- "sourceMapPathOverrides": {
- "webpack:///src/*": "${webRoot}/*"
- }
- }]
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "Chrome",
+ "type": "chrome",
+ "request": "launch",
+ "url": "http://localhost:3000",
+ "webRoot": "${workspaceRoot}/src",
+ "sourceMapPathOverrides": {
+ "webpack:///src/*": "${webRoot}/*"
+ }
+ }
+ ]
}
```
@@ -347,11 +349,11 @@ Alternatively you may use `yarn`:
yarn add husky lint-staged prettier
```
-* `husky` makes it easy to use githooks as if they are npm scripts.
-* `lint-staged` allows us to run scripts on staged files in git. See
- this [blog post about lint-staged to learn more about it](https://medium.com/@okonetchnikov/make-linting-great-again-f3890e1ad6b8)
- .
-* `prettier` is the JavaScript formatter we will run before commits.
+- `husky` makes it easy to use githooks as if they are npm scripts.
+- `lint-staged` allows us to run scripts on staged files in git. See
+ this [blog post about lint-staged to learn more about it](https://medium.com/@okonetchnikov/make-linting-great-again-f3890e1ad6b8)
+ .
+- `prettier` is the JavaScript formatter we will run before commits.
Now we can make sure every file is formatted correctly by adding a few lines to the `package.json` in the project root.
@@ -432,12 +434,12 @@ For example:
### `Button.js`
```js
-import React, { Component } from 'react';
+import React, { Component } from "react";
class Button extends Component {
- render() {
- // ...
- }
+ render() {
+ // ...
+ }
}
export default Button; // Don’t forget to use export default!
@@ -446,13 +448,13 @@ export default Button; // Don’t forget to use export default!
### `DangerButton.js`
```js
-import React, { Component } from 'react';
-import Button from './Button'; // Import a component from another file
+import React, { Component } from "react";
+import Button from "./Button"; // Import a component from another file
class DangerButton extends Component {
- render() {
- return ;
- }
+ render() {
+ return ;
+ }
}
export default DangerButton;
@@ -470,9 +472,9 @@ and as many named exports as you like.
Learn more about ES6 modules:
-* [When to use the curly braces?](http://stackoverflow.com/questions/36795819/react-native-es-6-when-should-i-use-curly-braces-for-import/36796281#36796281)
-* [Exploring ES6: Modules](http://exploringjs.com/es6/ch_modules.html)
-* [Understanding ES6: Modules](https://leanpub.com/understandinges6/read#leanpub-auto-encapsulating-code-with-modules)
+- [When to use the curly braces?](http://stackoverflow.com/questions/36795819/react-native-es-6-when-should-i-use-curly-braces-for-import/36796281#36796281)
+- [Exploring ES6: Modules](http://exploringjs.com/es6/ch_modules.html)
+- [Understanding ES6: Modules](https://leanpub.com/understandinges6/read#leanpub-auto-encapsulating-code-with-modules)
## Code Splitting
@@ -491,7 +493,7 @@ Here is an example:
### `moduleA.js`
```js
-const moduleA = 'Hello';
+const moduleA = "Hello";
export { moduleA };
```
@@ -499,26 +501,26 @@ export { moduleA };
### `App.js`
```js
-import React, { Component } from 'react';
+import React, { Component } from "react";
class App extends Component {
- handleClick = () => {
- import('./moduleA')
- .then(({ moduleA }) => {
- // Use moduleA
- })
- .catch(err => {
- // Handle failure
- });
- };
-
- render() {
- return (
-
+ );
+ }
}
export default App;
@@ -547,21 +549,21 @@ to **import the CSS from the JavaScript file**:
```css
.Button {
- padding: 20px;
+ padding: 20px;
}
```
### `Button.js`
```js
-import React, { Component } from 'react';
-import './Button.css'; // Tell Webpack that Button.js uses these styles
+import React, { Component } from "react";
+import "./Button.css"; // Tell Webpack that Button.js uses these styles
class Button extends Component {
- render() {
- // You can use them as regular CSS styles
- return ;
- }
+ render() {
+ // You can use them as regular CSS styles
+ return ;
+ }
}
```
@@ -585,9 +587,9 @@ For example, this:
```css
.App {
- display: flex;
- flex-direction: row;
- align-items: center;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
}
```
@@ -595,16 +597,16 @@ becomes this:
```css
.App {
- display: -webkit-box;
- display: -ms-flexbox;
- display: flex;
- -webkit-box-orient: horizontal;
- -webkit-box-direction: normal;
- -ms-flex-direction: row;
- flex-direction: row;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
+ display: -webkit-box;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-box-orient: horizontal;
+ -webkit-box-direction: normal;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
}
```
@@ -656,7 +658,7 @@ edit `src/App.scss`, and `src/App.css` will be regenerated.
To share variables between Sass files, you can use Sass imports. For example, `src/App.scss` and other component style
files could include `@import "./shared.scss";` with variable definitions.
-To enable importing files without using relative paths, you can add the `--include-path` option to the command
+To enable importing files without using relative paths, you can add the `--include-path` option to the command
in `package.json`.
```
@@ -667,8 +669,8 @@ in `package.json`.
This will allow you to do imports like
```scss
-@import 'styles/_colors.scss'; // assuming a styles directory under src/
-@import 'nprogress/nprogress'; // importing a css file from the nprogress node module
+@import "styles/_colors.scss"; // assuming a styles directory under src/
+@import "nprogress/nprogress"; // importing a css file from the nprogress node module
```
At this point you might want to remove all CSS files from the source control, and add `src/**/*.css` to
@@ -711,13 +713,13 @@ Now running `npm start` and `npm run build` also builds Sass files.
`node-sass` has been reported as having the following issues:
-- `node-sass --watch` has been reported to have *performance issues* in certain conditions when used in a virtual
- machine or with docker.
+- `node-sass --watch` has been reported to have _performance issues_ in certain conditions when used in a virtual
+ machine or with docker.
-- Infinite styles compiling [#1939](https://github.com/facebookincubator/create-react-app/issues/1939)
+- Infinite styles compiling [#1939](https://github.com/facebookincubator/create-react-app/issues/1939)
-- `node-sass` has been reported as having issues with detecting new files in a
- directory [#1891](https://github.com/sass/node-sass/issues/1891)
+- `node-sass` has been reported as having issues with detecting new files in a
+ directory [#1891](https://github.com/sass/node-sass/issues/1891)
`node-sass-chokidar` is used here as it addresses these issues.
@@ -737,14 +739,14 @@ to [#1153](https://github.com/facebookincubator/create-react-app/issues/1153).
Here is an example:
```js
-import React from 'react';
-import logo from './logo.png'; // Tell Webpack this JS file uses this image
+import React from "react";
+import logo from "./logo.png"; // Tell Webpack this JS file uses this image
console.log(logo); // /logo.84287d09.png
function Header() {
- // Import result is the URL of your image
- return ;
+ // Import result is the URL of your image
+ return ;
}
export default Header;
@@ -757,7 +759,7 @@ This works in CSS too:
```css
.Logo {
- background-image: url(./logo.png);
+ background-image: url(./logo.png);
}
```
@@ -791,9 +793,9 @@ For example, see the sections on [adding a stylesheet](#adding-a-stylesheet)
and [adding images and fonts](#adding-images-fonts-and-files).
This mechanism provides a number of benefits:
-* Scripts and stylesheets get minified and bundled together to avoid extra network requests.
-* Missing files cause compilation errors instead of 404 errors for your users.
-* Result filenames include content hashes so you don’t need to worry about browsers caching their old versions.
+- Scripts and stylesheets get minified and bundled together to avoid extra network requests.
+- Missing files cause compilation errors instead of 404 errors for your users.
+- Result filenames include content hashes so you don’t need to worry about browsers caching their old versions.
However there is an **escape hatch** that you can use to add an asset outside of the module system.
@@ -804,7 +806,7 @@ called `PUBLIC_URL`.
Inside `index.html`, you can use it like this:
```html
-
+
```
Only files inside the `public` folder will be accessible by `%PUBLIC_URL%` prefix. If you need to use a file from `src`
@@ -827,10 +829,10 @@ render() {
Keep in mind the downsides of this approach:
-* None of the files in `public` folder get post-processed or minified.
-* Missing files will not be called at compilation time, and will cause 404 errors for your users.
-* Result filenames won’t include content hashes so you’ll need to add query arguments or rename them every time they
- change.
+- None of the files in `public` folder get post-processed or minified.
+- Missing files will not be called at compilation time, and will cause 404 errors for your users.
+- Result filenames won’t include content hashes so you’ll need to add query arguments or rename them every time they
+ change.
### When to Use the `public` Folder
@@ -838,12 +840,12 @@ Normally we recommend importing [stylesheets](#adding-a-stylesheet), [images, an
from JavaScript.
The `public` folder is useful as a workaround for a number of less common cases:
-* You need a file with a specific name in the build output, such
- as [`manifest.webmanifest`](https://developer.mozilla.org/en-US/docs/Web/Manifest).
-* You have thousands of images and need to dynamically reference their paths.
-* You want to include a small script like [`pace.js`](http://github.hubspot.com/pace/docs/welcome/) outside of the
- bundled code.
-* Some library may be incompatible with Webpack and you have no other option but to include it as a `
-
+
+
+
+
+