Skip to content

Commit

Permalink
Serve font locally
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmartinelli committed Nov 23, 2016
1 parent 72c6def commit fd0b3b5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -51,7 +51,7 @@ Maputnik is written in ES6 and is using [React](https://github.com/facebook/reac
We ensure building and developing Maputnik works with

- Linux, OSX and Windows
- Node 5.11
- Node >4

Install the deps, start the dev server and open the web browser on `http://localhost:8888/`.

Expand Down
1 change: 1 addition & 0 deletions src/app.jsx
Expand Up @@ -13,6 +13,7 @@ import { loadDefaultStyle, SettingsStore, StyleStore } from './stylestore.js'
import { WorkspaceDrawer } from './workspace.jsx'

import theme from './theme.js'
import './index.scss'

export default class App extends React.Component {
static childContextTypes = {
Expand Down
Binary file added src/fonts/Roboto-Regular.ttf
Binary file not shown.
6 changes: 6 additions & 0 deletions src/index.scss
@@ -1,3 +1,9 @@
@font-face {
font-family: 'Roboto';
src: url('./fonts/Roboto-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
.app {

}
1 change: 0 additions & 1 deletion src/template.html
Expand Up @@ -4,7 +4,6 @@
<meta charset="utf-8">
<title><%= htmlWebpackPlugin.options.title %></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,700" rel="stylesheet">
</head>
<body>
<div id="app">Loading...</div>
Expand Down
15 changes: 2 additions & 13 deletions webpack.loaders.js
Expand Up @@ -14,19 +14,8 @@ module.exports = [
}
},
{
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
exclude: /(node_modules|bower_components)/,
loader: "file"
},
{
test: /\.(woff|woff2)$/,
exclude: /(node_modules|bower_components)/,
loader: "url?prefix=font/&limit=5000"
},
{
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
exclude: /(node_modules|bower_components)/,
loader: "url?limit=10000&mimetype=application/octet-stream"
test: /\.(eot|svg|ttf|woff|woff2)$/,
loader: 'file?name=fonts/[name].[ext]'
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
Expand Down

0 comments on commit fd0b3b5

Please sign in to comment.