tnc-ca-geo / frontend-boilerplate

For bootstrapping web-maps with React, Redux, and ESRI JS API
0 stars 0 forks source link

WOFF and TFF fonts not loading from ESRI css #1

Closed nathanielrindlaub closed 5 years ago

nathanielrindlaub commented 5 years ago

Something must be up with the webpack config.

I got the same issue if I clone and run https://github.com/odoe/jsapi-webpack, and then fixed it by using url-loader instead of file-loader:

From:

      {
        test: /\.(wsv|ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
        use: [
          "cache-loader",
          {
            loader: "file-loader",
            options: {
              name: "build/[name].[ext]"
            }
          }
        ]
      }

To:

      {
        test: /\.(wsv|ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
        use: [
          'cache-loader',
          {
            // NOTE: original config used file-loader for fonts, but it wasn't
            // working. Reverted to url-loader
            loader: 'url-loader',
            options: {
              limit: 10 * 1024,
            }
          }
        ]
      }

But the URL loader doesn't seem to work now either...

nathanielrindlaub commented 5 years ago

Fixed by not using cache-loader for font files