Skip to content

Commit ce21c9e

Browse files
committed
build(example): Replace icon pack for tree shaking and fix purgecss
1 parent 4010f29 commit ce21c9e

File tree

6 files changed

+62
-16
lines changed

6 files changed

+62
-16
lines changed

example/package-lock.json

Lines changed: 51 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dependencies": {
1212
"components": "^0.1.0",
1313
"react-app-polyfill": "^1.0.0",
14-
"react-icons": "^3.10.0"
14+
"react-icons-kit": "^1.3.1"
1515
},
1616
"alias": {
1717
"react": "../node_modules/react",
@@ -29,4 +29,4 @@
2929
"tailwindcss": "^1.3.5",
3030
"typescript": "^3.4.5"
3131
}
32-
}
32+
}

example/postcss.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ const tailwindcss = require('tailwindcss');
22
const autoprefixer = require('autoprefixer');
33
const cssnano = require('cssnano');
44
const purgecss = require('@fullhuman/postcss-purgecss')({
5-
content: ['./*.html', './*.tsx', './components/*.tsx'],
5+
content: ['./*.html', './*.tsx', './src/*.tsx'],
66
defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || [],
77
});
88

9+
console.log(`NODE_ENV: ${process.env.NODE_ENV}`);
10+
911
module.exports = {
1012
plugins: [
1113
tailwindcss(),

example/src/Header.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as React from 'react';
2-
import { FaGithub } from 'react-icons/fa';
2+
import { Icon } from 'react-icons-kit';
3+
import { github } from 'react-icons-kit/fa/github';
34
// @ts-ignore
45
import images from '../*.png';
56

@@ -11,7 +12,7 @@ export const Header = () => {
1112
<div className="lg:pr-16">
1213
<h1 className="mb-4 text-5xl font-bold">React Simple Hook Modal</h1>
1314
<div className="flex flex-row items-center justify-center lg:justify-end pb-8">
14-
<FaGithub className="inline" />
15+
<Icon icon={github} className="inline" />
1516
<a
1617
className="ml-2 hover:text-blue-300 transition transition-colors duration-200"
1718
href="https://github.com/mbrookson/react-simple-hook-modal"

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"license": "MIT",
44
"name": "react-simple-hook-modal",
55
"description": "A simple React modal with hook based API",
6-
"homepage": "https://github.com/mbrookson/react-simple-hook-modal",
6+
"homepage": "https://react-simple-hook-modal.now.sh",
77
"repository": {
88
"type": "git",
99
"url": "https://github.com/mbrookson/react-simple-hook-modal.git"
@@ -21,6 +21,7 @@
2121
"scripts": {
2222
"start": "tsdx watch",
2323
"build": "tsdx build",
24+
"build:all": "tsdx build && cd example && npm install && npm run build",
2425
"test": "tsdx test --passWithNoTests",
2526
"lint": "tsdx lint",
2627
"install-peers": "install-peers -f"

0 commit comments

Comments
 (0)