-
Notifications
You must be signed in to change notification settings - Fork 3
/
craco.config.js
40 lines (38 loc) · 1.25 KB
/
craco.config.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
const path = require('path');
const tailwindcss = require('tailwindcss');
const VersionFile = require('webpack-version-file');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
const packageJson = require('./package.json');
require('dotenv').config({ path: `./env/${process.env.ENV_CONFIG ?? `.env`}` });
module.exports = {
webpack: {
alias: {
'@': path.resolve(__dirname, 'src')
},
plugins: [
new VersionFile({
output: './build/version.txt',
templateString: [
'<%= name %>@<%= version %>',
'Build date: <%= buildDate %>',
'Portal version: <%= neonPortalVersion %>',
'TokenList version: <%= tokenListVersion %>'
].join('\n'),
data: {
neonPortalVersion: packageJson.dependencies['neon-portal'],
tokenListVersion: process.env.REACT_APP_TOKEN_LIST
}
}),
new NodePolyfillPlugin({ excludeAliases: ['console'] })
],
fallback: {
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
assert: require.resolve('assert'),
buffer: require.resolve('buffer')
}
},
postcss: {
plugins: [tailwindcss('./tailwind.config.js'), require('autoprefixer')]
}
};