forked from taskcluster/taskcluster-tools
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.neutrinorc.js
113 lines (105 loc) · 3.12 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
const merge = require('deepmerge');
const { ProvidePlugin } = require('webpack');
// Increment the version whenever you need a full invalidation
// but hashes could remain the same
const CACHE_VERSION = 'v1';
const envs = {
AUTH0_DOMAIN: 'auth.mozilla.auth0.com',
AUTH0_CLIENT_ID: 'TBD',
AUTH0_AUDIENCE: 'login.taskcluster.net',
SIGN_IN_METHODS: process.env.NODE_ENV === 'development' ? 'development' : 'auth0 manual'
};
// Set environment variables to their default values if not defined
Object
.keys(envs)
.forEach(env => !(env in process.env) && (process.env[env] = envs[env]));
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: 9000,
historyApiFallback: { disableDotRule: true }
},
html: {
title: 'Taskcluster Tools',
mobile: true,
meta: [
{
name: 'description',
content: `A collection of tools for Taskcluster components and elements in the Taskcluster ecosystem. Here
you'll find tools to manage Taskcluster as well as run, debug, inspect, and view tasks, task groups, and
other Taskcluster related entities.`
},
{
name: 'author',
content: 'Mozilla Taskcluster Team'
}
]
}
}
}],
['@neutrinojs/env', Object.keys(envs)],
(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'
]);
}
],
};