Skip to content

Commit 8a54dea

Browse files
committed
fix(documentation): fix url redirect for gh pages
1 parent ec20135 commit 8a54dea

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

config/webpack.common.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ module.exports = function (options) {
178178
{
179179
test: /\.html$/,
180180
use: 'raw-loader',
181-
exclude: [helpers.root('demo/src/index.html')]
181+
exclude: [helpers.root('demo/src/index.html'), helpers.root('demo/src/404.html')]
182182
},
183183

184184
/* File loader for supporting images, for example, in CSS files.

config/webpack.prod.js

+25-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplaceme
1313
const ProvidePlugin = require('webpack/lib/ProvidePlugin');
1414
const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin');
1515
const OptimizeJsPlugin = require('optimize-js-plugin');
16+
const HtmlWebpackPlugin = require('html-webpack-plugin');
1617

1718
/**
1819
* Webpack Constants
@@ -24,7 +25,8 @@ const METADATA = webpackMerge(commonConfig({env: ENV}).metadata, {
2425
host: HOST,
2526
port: PORT,
2627
ENV: ENV,
27-
HMR: false
28+
HMR: false,
29+
ghRedirectPath: '/ng2-smart-table/',
2830
});
2931

3032
module.exports = function (env) {
@@ -212,6 +214,28 @@ module.exports = function (env) {
212214
// threshold: 2 * 1024
213215
// })
214216

217+
/*
218+
* Plugin: HtmlWebpackPlugin
219+
* Description: Simplifies creation of HTML files to serve your webpack bundles.
220+
* This is especially useful for webpack bundles that include a hash in the filename
221+
* which changes every compilation.
222+
*
223+
* See: https://github.com/ampedandwired/html-webpack-plugin
224+
*/
225+
new HtmlWebpackPlugin({
226+
template: 'demo/src/index.html',
227+
title: METADATA.title,
228+
chunksSortMode: 'dependency',
229+
metadata: METADATA,
230+
inject: 'head'
231+
}),
232+
new HtmlWebpackPlugin({
233+
template: 'demo/src/404.html',
234+
filename: '404.html',
235+
metadata: METADATA,
236+
inject: false
237+
}),
238+
215239
/**
216240
* Plugin LoaderOptionsPlugin (experimental)
217241
*

0 commit comments

Comments
 (0)