Skip to content

Commit

Permalink
fix(documentation): fix url redirect for gh pages
Browse files Browse the repository at this point in the history
  • Loading branch information
nnixaa committed Feb 17, 2017
1 parent ec20135 commit 8a54dea
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ module.exports = function (options) {
{
test: /\.html$/,
use: 'raw-loader',
exclude: [helpers.root('demo/src/index.html')]
exclude: [helpers.root('demo/src/index.html'), helpers.root('demo/src/404.html')]
},

/* File loader for supporting images, for example, in CSS files.
Expand Down
26 changes: 25 additions & 1 deletion config/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplaceme
const ProvidePlugin = require('webpack/lib/ProvidePlugin');
const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin');
const OptimizeJsPlugin = require('optimize-js-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');

/**
* Webpack Constants
Expand All @@ -24,7 +25,8 @@ const METADATA = webpackMerge(commonConfig({env: ENV}).metadata, {
host: HOST,
port: PORT,
ENV: ENV,
HMR: false
HMR: false,
ghRedirectPath: '/ng2-smart-table/',
});

module.exports = function (env) {
Expand Down Expand Up @@ -212,6 +214,28 @@ module.exports = function (env) {
// threshold: 2 * 1024
// })

/*
* Plugin: HtmlWebpackPlugin
* Description: Simplifies creation of HTML files to serve your webpack bundles.
* This is especially useful for webpack bundles that include a hash in the filename
* which changes every compilation.
*
* See: https://github.com/ampedandwired/html-webpack-plugin
*/
new HtmlWebpackPlugin({
template: 'demo/src/index.html',
title: METADATA.title,
chunksSortMode: 'dependency',
metadata: METADATA,
inject: 'head'
}),
new HtmlWebpackPlugin({
template: 'demo/src/404.html',
filename: '404.html',
metadata: METADATA,
inject: false
}),

/**
* Plugin LoaderOptionsPlugin (experimental)
*
Expand Down

0 comments on commit 8a54dea

Please sign in to comment.