forked from mozilla-frontend-infra/codetribute
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.neutrinorc.js
52 lines (51 loc) · 1.44 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
const fs = require('fs-extra');
const { join } = require('path');
module.exports = {
use: [
['neutrino-preset-mozilla-frontend-infra/react', {
html: {
title: 'Codetribute',
meta: [
{
name: 'Description',
content: 'Find your first code contribution with Mozilla',
},
],
links: [
{
href: './static/favicon.png',
rel: 'shortcut icon',
}
]
},
}],
['@neutrinojs/env', ['GITHUB_PERSONAL_API_TOKEN', 'BUGZILLA_ENDPOINT', 'NODE_ENV']],
(neutrino) => {
neutrino.config.output.publicPath('/');
neutrino.config.module
.rule('js-yaml')
.test(/\.(yaml|yml)$/)
.use('js-yaml-loader')
.loader('js-yaml-loader');
neutrino.config.module
.rule('graphql')
.test(/\.graphql$/)
.include
.add(neutrino.options.source)
.end()
.use('gql-loader')
.loader(require.resolve('graphql-tag/loader'));
// Data URIs are not allowed by the CSP
['ico', 'svg', 'img']
.forEach(rule => neutrino.config.module.rule(rule)
.use('url')
.tap(options => ({ ...options, limit: 1 })));
neutrino.on('build', () => {
['contribute.json'].forEach(file => {
fs.copyFileSync(file, join(__dirname, `build/${file}`));
})
});
},
'@neutrinojs/jest'
],
};