Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lynx committed Jul 3, 2019
1 parent c31461d commit 35e53b7
Show file tree
Hide file tree
Showing 17 changed files with 600 additions and 297 deletions.
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 impulse

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
74 changes: 26 additions & 48 deletions README.md
@@ -1,68 +1,46 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
# Create React App Tailwind starter

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.<br>
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br>
You will also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.<br>
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
[![License: MIT](https://img.shields.io/github/license/impulse/cra-tailwind-starter.svg)](https://opensource.org/licenses/MIT)
<img alt="GitHub top language" src="https://img.shields.io/github/languages/top/impulse/cra-tailwind-starter.svg">

### `npm run build`
## About

Builds the app for production to the `build` folder.<br>
It correctly bundles React in production mode and optimizes the build for the best performance.
Tailwind starter project based on create-react-app

The build is minified and the filenames include the hashes.<br>
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
## Available Scripts

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
In the project directory, you can run:

## Learn More
### `dev`

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
Watches and rebuilds css changes and starts dev server<br>

To learn React, check out the [React documentation](https://reactjs.org/).
### `npm start`

### Code Splitting
Builds css once and starts react-scripts.<br>

This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
### `npm build`

### Analyzing the Bundle Size
Builds production ready project.<br>

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
### `build:css`

### Making a Progressive Web App
Builds css once.<br>

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
### `watch:css`

### Advanced Configuration
Watches and rebuilds css.<br>

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
## Contributing

### Deployment
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

### `npm run build` fails to minify
## License

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
Distributed under the MIT License. See `LICENSE` for more information.
19 changes: 15 additions & 4 deletions package.json
@@ -1,17 +1,20 @@
{
"name": "cra-tailwind-starter",
"version": "0.1.0",
"private": true,
"private": false,
"dependencies": {
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-scripts": "3.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"start": "yarn run build:css && react-scripts start",
"build": "yarn run build:css && react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"build:css": "postcss src/css/index.src.css -o src/css/index.css",
"watch:css": "postcss src/css/index.src.css -o src/css/index.css -w",
"dev": "concurrently \"yarn watch:css --silent\" \"yarn start --silent\""
},
"eslintConfig": {
"extends": "react-app"
Expand All @@ -27,5 +30,13 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@fullhuman/postcss-purgecss": "^1.2.0",
"autoprefixer": "^9.6.0",
"concurrently": "^4.1.1",
"cssnano": "^4.1.10",
"postcss-cli": "^6.1.2",
"tailwindcss": "^1.0.4"
}
}
32 changes: 32 additions & 0 deletions postcss.config.js
@@ -0,0 +1,32 @@
const tailwindcss = require("tailwindcss");
const purgecss = require("@fullhuman/postcss-purgecss");

/**
* Custom PurgeCSS Extractor
* https://github.com/FullHuman/purgecss
*/
class TailwindExtractor {
static extract(content) {
return content.match(/[A-z0-9-:\/]+/g);
}
}

module.exports = {
plugins: [
tailwindcss("./tailwind.config.js"),
require("autoprefixer"),
require("cssnano")({ preset: "default" }),
process.env.NODE_ENV === "production" &&
purgecss({
content: ["**/*.html", "./src/**/*.js", "./src/**/*.jsx"],
css: ["./src/**/*.css"],
extractors: [
{
extractor: TailwindExtractor,
// Specify the file extensions to include when scanning
extensions: ["html", "js", "jsx", "css"]
}
]
})
]
};
5 changes: 5 additions & 0 deletions renovate.json
@@ -0,0 +1,5 @@
{
"extends": ["config:base"],
"assignees": ["impulse"],
"bumpVersion": "patch"
}
33 changes: 0 additions & 33 deletions src/App.css

This file was deleted.

26 changes: 0 additions & 26 deletions src/App.js

This file was deleted.

9 changes: 0 additions & 9 deletions src/App.test.js

This file was deleted.

1 change: 1 addition & 0 deletions src/css/index.css

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/css/index.src.css
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
13 changes: 0 additions & 13 deletions src/index.css

This file was deleted.

16 changes: 5 additions & 11 deletions src/index.js
@@ -1,12 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
import React from "react";
import ReactDOM from "react-dom";
import "./css/index.css";
import App from "./pages/App";

ReactDOM.render(<App />, document.getElementById('root'));

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
ReactDOM.render(<App />, document.getElementById("root"));
7 changes: 0 additions & 7 deletions src/logo.svg

This file was deleted.

0 comments on commit 35e53b7

Please sign in to comment.