-
Notifications
You must be signed in to change notification settings - Fork 278
/
Copy pathcraco.config.js
38 lines (35 loc) · 951 Bytes
/
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
const path = require('path');
const babelInclude = require('@dealmore/craco-plugin-babel-include');
const webpack = require('webpack');
const LIB_PATH = `../package/dist/Slider.js`;
module.exports = {
webpack: {
alias: {
'react-native$': 'react-native-web',
'@react-native-community/slider': path.resolve(__dirname, LIB_PATH),
// make sure we don't include multiple versions of react
'react': path.resolve(__dirname, './node_modules/react'),
},
babel: {
presets: [
'@babel/preset-react',
'@babel/preset-typescript',
],
plugins: [
'@babel/plugin-proposal-private-methods',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-private-property-in-object',
],
},
},
plugins: [
{
plugin: babelInclude,
options: {
include: [
path.resolve(__dirname, LIB_PATH),
],
},
},
],
};