forked from maidsafe/dev-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatic.config.js
More file actions
63 lines (62 loc) · 1.89 KB
/
static.config.js
File metadata and controls
63 lines (62 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import React from 'react'
import axios from 'axios'
import ExtractTextPlugin from 'extract-text-webpack-plugin'
//
import routes from './routes';
export default {
getSiteData: () => ({
title: 'React Static',
}),
getRoutes: async () => routes,
webpack: (config, { defaultLoaders, stage }) => {
config.module.rules = [
{
oneOf: [
{
test: /\.s(a|c)ss$/,
use:
stage === 'dev'
? [{ loader: 'style-loader' }, { loader: 'css-loader' }, { loader: 'sass-loader' }]
: ExtractTextPlugin.extract({
use: [
{
loader: 'css-loader',
options: {
importLoaders: 1,
minimize: true,
sourceMap: false,
},
},
{
loader: 'sass-loader',
options: { includePaths: ['src/'] },
},
],
}),
},
defaultLoaders.cssLoader,
defaultLoaders.jsLoader,
defaultLoaders.fileLoader,
],
},
]
if(stage != 'dev') {
config.plugins = [
new ExtractTextPlugin('styles.css')
]
}
return config
},
Document: ({ Html, Head, Body, children, siteData, renderMeta }) => (
<Html lang="en-US">
<Head>
<meta charSet="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="keywords" content="DevHub, MaidSafe, Safe, Safe Network, Autonomous, Developer, Decentralised, Safe Coin, Distributed Platform" />
<link rel="shortcut icon" type="image/icon" href="/images/favicon.ico" />
<title>SAFE Network - DevHub</title>
</Head>
<Body>{children}</Body>
</Html>
),
}