-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig-overrides.js
30 lines (28 loc) · 985 Bytes
/
config-overrides.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
const StylelintPlugin = require('stylelint-webpack-plugin')
const { override, addWebpackPlugin } = require('customize-cra')
const webpack = require('webpack')
const packageJson = require('./package.json')
module.exports = override(
(
() => {
if (process.env.NODE_ENV === 'development') {
// check style files on development only
return addWebpackPlugin(
new StylelintPlugin({
context: 'src/style',
})
)
}
}
)(),
addWebpackPlugin(
// define extra environment variables
new webpack.DefinePlugin({
'process.env.DAKARA_VERSION': JSON.stringify(packageJson.version),
'process.env.DAKARA_BUGTRACKER': JSON.stringify(packageJson.bugs.url),
'process.env.DAKARA_PROJECT_HOMEPAGE': JSON.stringify(
packageJson.projectHomepage
),
})
),
)