Merge pull request #6 from iqnivek/use_docs_folder_for_github_pages

Use docs folder for GitHub pages
This commit is contained in:
Kevin Qi 2017-02-04 20:26:05 -08:00 committed by GitHub
commit 984ef65ac3
8 changed files with 21833 additions and 25 deletions

1
.gitignore vendored
View File

@ -2,5 +2,4 @@ node_modules
npm-debug.log
.DS_Store
build
demo/index.js
.cache

21827
docs/index.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -16,9 +16,7 @@
"svg"
],
"scripts": {
"build": "NODE_ENV=production webpack",
"build:demo": "NODE_ENV=demo webpack",
"deploy:demo": "npm run build:demo && ./scripts/build_ghpages.sh",
"build": "NODE_ENV=production webpack && NODE_ENV=demo webpack",
"clean": "rimraf build",
"lint": "eslint src test",
"prepublish": "npm run clean && npm run build",

View File

@ -1,17 +0,0 @@
#!/bin/sh
cp -R ./demo .cache
rm .cache/demo.jsx
rm .cache/styles.css
cp src/styles.css .cache
git checkout gh-pages
mv ./.cache/* .
rm -rf .cache
# git add .
# git commit -m "Update demo page"
# git push
# git checkout master

View File

@ -2,6 +2,7 @@ const webpack = require('webpack');
const path = require('path');
const pak = require('./package.json');
const nodeEnv = process.env.NODE_ENV || 'development';
const demoDir = 'docs';
const webpackConfig = {
context: __dirname,
@ -39,15 +40,15 @@ const webpackConfig = {
if (nodeEnv === 'development') {
webpackConfig.devtool = 'source-map';
webpackConfig.debug = true;
webpackConfig.devServer = { contentBase: './demo'};
webpackConfig.devServer = { contentBase: path.resolve(__dirname, demoDir) };
webpackConfig.entry['react-circular-progressbar'].unshift('webpack-dev-server/client?http://0.0.0.0:8080/');
webpackConfig.entry['react-circular-progressbar'].push(path.resolve(__dirname, 'demo', 'demo.jsx'));
webpackConfig.entry['react-circular-progressbar'].push(path.resolve(__dirname, demoDir, 'demo.jsx'));
webpackConfig.output.publicPath = '/';
}
if (nodeEnv === 'demo') {
webpackConfig.entry['react-circular-progressbar'].push(path.resolve(__dirname, 'demo', 'demo.jsx'));
webpackConfig.output.path = path.resolve(__dirname, 'demo');
webpackConfig.entry['react-circular-progressbar'].push(path.resolve(__dirname, demoDir, 'demo.jsx'));
webpackConfig.output.path = path.resolve(__dirname, demoDir);
}
if (nodeEnv === 'development' || nodeEnv === 'demo') {