forked from facebook/create-react-app
-
Notifications
You must be signed in to change notification settings - Fork 96
/
Copy pathApp.js
126 lines (113 loc) · 3.6 KB
/
App.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import React, { Component } from 'react';
import logo from './logo.svg';
//components
import Emoji from './Emoji';
//styles
import './App.scss';
import './App.less';
import './App.styl';
//modules
import cssStyles from './First.module.css';
import sassStyles from './Second.module.scss';
import lessStyles from './Third.module.less';
import stylusStyles from './Fourth.module.styl';
class App extends Component {
render() {
return (
<div className="App">
<header className={cssStyles.header}>
<img src={logo} className="App-logo" alt="logo" />
<h2 className="App-title">
<Emoji label="danger" emoji="☢" />
<span> custom-react-scripts </span>
<Emoji label="danger" emoji="☢" />
</h2>
<div className="App-subtitle">
allow custom config for create-react-app without ejecting
</div>
</header>
<div className={stylusStyles.description}>
<div className={sassStyles.command}>
<code>
create-react-app my-app --scripts-version custom-react-scripts
</code>
</div>
<p>
If you want to enable/disable certain features just modify the
<b> .env</b> file in the root directory of the project.
</p>
<b> Styling </b>
<ul className="configs style-configs">
<li>
<code>REACT_APP_SASS=true</code>
<span>- Enable SASS</span>
</li>
<li>
<code>REACT_APP_LESS=true</code>
<span>- Enable LESS</span>
</li>
<li>
<code>REACT_APP_STYLUS=true</code>
<span>- Enable Stylus</span>
</li>
<li>
<code>REACT_APP_CSS_MODULES=true</code>
<span>- Enable CSS modules </span>
</li>
<li>
<code>REACT_APP_SASS_MODULES=true</code>
<span>- Enable Sass modules </span>
</li>
<li>
<code>REACT_APP_SASS_MODULES=true</code>
<span>- Enable Stylus modules </span>
</li>
<li>
<code>REACT_APP_SASS_MODULES=true</code>
<span>- Enable Less modules </span>
</li>
</ul>
<b>Babel</b>
<ul className="configs babel-configs">
<li>
<code>REACT_APP_BABEL_STAGE_0=true</code>
<span>- Enable stage-0 preset</span>
</li>
<li>
<code>REACT_APP_DECORATORS=true</code>
<span>- Enable usage of decorators</span>
</li>
</ul>
<b>Other</b>
<ul className="configs babel-configs">
<li>
<code>REACT_APP_WEBPACK_DASHBOARD=true</code>
<span>
- Enables connection to {' '}
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/FormidableLabs/electron-webpack-dashboard"
>
webpack-dashboard
</a>{' '}
(must be installed)
</span>
</li>
</ul>
<br />
<br />
<a
target="_blank"
rel="noopener noreferrer"
className={lessStyles.readmeLink}
href="https://github.com/kitze/create-react-app/tree/master/packages/react-scripts"
>
Link to full README.md
</a>
</div>
</div>
);
}
}
export default App;