Skip to content

Commit f898e56

Browse files
committed
Use the /docs folder for GitHub Pages
1 parent 9b05ced commit f898e56

14 files changed

+2700
-5
lines changed

docs/0.bundle.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/0.bundle.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/1.bundle.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/1.bundle.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
162 KB
Binary file not shown.

docs/912ec66d7572ff821749319396470bde.svg

+2,671
Loading
75.4 KB
Binary file not shown.
162 KB
Binary file not shown.
95.7 KB
Binary file not shown.

docs/index.bundle.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.bundle.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<title>Custom Widget</title>
7+
<meta name="description" content="">
8+
<meta name="viewport" content="width=device-width, initial-scale=1">
9+
</head>
10+
<body>
11+
<div id="viewport"></div>
12+
</html>
13+
<script type="text/javascript" src="index.bundle.js?_=1509206932083"></script>

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
"dist"
88
],
99
"scripts": {
10-
"prepublish": "npm run eslint && npm test && npm run clean && npm run build",
11-
"build": "webpack --config webpack.config.js",
10+
"prepublish": "npm run eslint && npm test && npm run clean && npm run build && npm run build-docs",
1211
"clean": "del-cli dist",
12+
"build": "cross-env OUTPUT_PATH=dist webpack --config webpack.config.js",
13+
"build-docs": "cross-env OUTPUT_PATH=docs webpack --config webpack.config.js",
1314
"demo": "http-server -p 8080 dist",
1415
"eslint": "eslint ./src",
1516
"test": "tap test/*.js --node-arg=--require --node-arg=babel-register --node-arg=--require --node-arg=babel-polyfill",

webpack.config.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
77
const stylusLoader = require('stylus-loader');
88
const nib = require('nib');
99

10+
const outputPath = process.env.OUTPUT_PATH || 'dist';
1011
const timestamp = new Date().getTime();
1112
const webpackConfig = {
1213
entry: {
@@ -15,7 +16,7 @@ const webpackConfig = {
1516
]
1617
},
1718
output: {
18-
path: path.join(__dirname, 'dist'),
19+
path: path.join(__dirname, outputPath),
1920
chunkFilename: `[name].bundle.js?_=${timestamp}`,
2021
filename: `[name].bundle.js?_=${timestamp}`
2122
},
@@ -113,7 +114,7 @@ if (process.env.NODE_ENV === 'development') {
113114
}
114115
}),
115116
new HtmlWebpackPlugin({
116-
filename: path.join(__dirname, 'dist/index.html'),
117+
filename: path.join(__dirname, outputPath, 'index.html'),
117118
template: path.join(__dirname, 'assets/index.html')
118119
})
119120
];
@@ -150,7 +151,7 @@ if (process.env.NODE_ENV === 'development') {
150151
}
151152
}),
152153
new HtmlWebpackPlugin({
153-
filename: path.join(__dirname, 'dist/index.html'),
154+
filename: path.join(__dirname, outputPath, 'index.html'),
154155
template: path.join(__dirname, 'assets/index.html')
155156
})
156157
];

0 commit comments

Comments
 (0)