-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcraco.config.js
More file actions
29 lines (27 loc) · 775 Bytes
/
Copy pathcraco.config.js
File metadata and controls
29 lines (27 loc) · 775 Bytes
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
const path = require('path');
const _ = require('lodash');
const fs = require('fs');
module.exports = {
eslint: {
enable: false,
},
webpack: {
alias: {
react: 'preact/compat',
'react-dom': 'preact/compat',
'react-dom/test-utils': 'preact/test-utils',
},
configure: (webpackConfig, { env, paths }) => {
// Alias @
_.set(webpackConfig, ['resolve', 'alias', '@'], path.resolve(__dirname, `${paths.appSrc}/`));
return webpackConfig;
},
},
devServer: (devServerConfig, { env, paths, proxy, allowedHost }) => {
devServerConfig.https = {
key: fs.readFileSync('./node_modules/localhost-certs/files/server.key', 'utf8'),
cert: fs.readFileSync('./node_modules/localhost-certs/files/server.crt', 'utf8'),
};
return devServerConfig;
},
};