mirror of
https://github.com/infeng/react-viewer.git
synced 2025-12-08 17:36:40 +00:00
add gh_pages build
This commit is contained in:
parent
9a811906f4
commit
296372f194
@ -7,7 +7,8 @@
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "dora --port 8001 --plugins \"webpack,webpack-hmr,browser-history?index=/demo/index.html\"",
|
||||
"lint": "tslint -c tslint.json src/**/*.ts src/**/*.tsx",
|
||||
"build": "atool-build --config webpack.config.prop.js && gulp"
|
||||
"build": "atool-build --config webpack.config.prop.js && gulp",
|
||||
"doc": "atool-build --config webpack.config.doc.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
42
webpack.config.doc.js
Normal file
42
webpack.config.doc.js
Normal file
@ -0,0 +1,42 @@
|
||||
const webpack = require('atool-build/lib/webpack');
|
||||
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
||||
var conf = {
|
||||
filename: 'index.html',
|
||||
template: './demo/index.html',
|
||||
inject: true,
|
||||
minify: {
|
||||
removeComments: true,
|
||||
collapseWhitespace: false
|
||||
},
|
||||
hash: true,
|
||||
}
|
||||
|
||||
module.exports = function (webpackConfig) {
|
||||
webpackConfig.entry = {
|
||||
index: './demo/index.tsx',
|
||||
};
|
||||
|
||||
webpackConfig.output.path = './docs';
|
||||
webpackConfig.output.publicPath = '/';
|
||||
|
||||
webpackConfig.module.loaders.forEach(function (loader, index) {
|
||||
if (loader.test.toString().indexOf('html') > 0) {
|
||||
loader.loader = 'html';
|
||||
}
|
||||
});
|
||||
|
||||
webpackConfig.plugins.push(
|
||||
new HtmlWebpackPlugin(conf)
|
||||
);
|
||||
|
||||
webpackConfig.plugins.some(function (plugin, i) {
|
||||
if (plugin instanceof webpack.optimize.CommonsChunkPlugin) {
|
||||
webpackConfig.plugins.splice(i, 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
return webpackConfig;
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user