This repository has been archived by the owner on Nov 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 91
/
.neutrinorc.js
119 lines (112 loc) · 3.39 KB
/
.neutrinorc.js
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
const merge = require('deepmerge');
const { ProvidePlugin } = require('webpack');
const GitRevisionPlugin = require('git-revision-webpack-plugin');
// Increment the version whenever you need a full invalidation
// but hashes could remain the same
const CACHE_VERSION = 'v1';
// SOURCE_VERSION is for Heroku
// https://github.com/pirelenito/git-revision-webpack-plugin/issues/19#issuecomment-389793896
process.env.COMMIT_HASH = process.env.SOURCE_VERSION || new GitRevisionPlugin().commithash();
module.exports = {
use: [
['neutrino-preset-mozilla-frontend-infra', {
cacheVersion: CACHE_VERSION,
eslint: {
rules: {
// TODO: Too much work to convert right now
'react/no-array-index-key': 'off',
'jsx-a11y/label-has-for': 'off',
'jsx-a11y/alt-text': 'off'
},
},
react: {
minify: {
style: false,
image: false,
},
devServer: {
port: +process.env.PORT,
historyApiFallback: { disableDotRule: true }
},
html: {
title: process.env.APPLICATION_NAME,
mobile: true,
meta: [
{
name: 'description',
content: `A collection of tools for ${process.env.APPLICATION_NAME} components and elements in the
${process.env.APPLICATION_NAME} ecosystem. Here you'll find tools to manage
${process.env.APPLICATION_NAME} services as well as run, debug, inspect, and view tasks, task groups,
and other ${process.env.APPLICATION_NAME} related entities.`
},
{
name: 'author',
content: process.env.APPLICATION_NAME
}
]
}
}
}],
['@neutrinojs/env', [
'NODE_ENV',
'APPLICATION_NAME',
'AUTH0_DOMAIN',
'AUTH0_CLIENT_ID',
'AUTH0_AUDIENCE',
'AUTH0_SCOPE',
'AUTH0_RESPONSE_TYPE',
'TASKCLUSTER_ROOT_URL',
'OIDC_PROVIDER',
'SIGN_IN_METHODS',
'COMMIT_HASH'
]],
(neutrino) => {
// Fix issue with nested routes e.g /index/garbage
neutrino.config.output.publicPath('/');
neutrino.config.node.set('Buffer', true);
// The JSONStream module's main file has a Node.js shebang
// which Webpack doesn't like loading as JS
neutrino.config.module
.rule('shebang')
.test(/JSONStream/)
.use('shebang')
.loader('shebang-loader');
neutrino.config
.externals(merge(neutrino.config.get('externals'), {
bindings: 'bindings'
}));
// Make variables `$` and `jQuery` available
neutrino.config
.plugin('jquery')
.use(ProvidePlugin, [{
$: 'jquery',
jQuery: 'jquery'
}]);
neutrino.config
.entry('vendor')
.merge([
'babel-polyfill',
'deepmerge',
'lodash.chunk',
'lodash.clonedeep',
'prop-types',
'ramda',
'markdown-it',
'highlight.js',
'moment',
'qs',
'react',
'react-tooltip',
'react-bootstrap',
'react-loadable',
'react-fontawesome',
'react-router-bootstrap',
'slugid',
'react-dom',
'react-helmet',
'react-router-dom',
'taskcluster-client-web'
]);
}
],
};