Skip to content

Commit

Permalink
added HtmlWebpackPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
estkin committed Feb 12, 2016
1 parent 3af7579 commit c3de411
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 17 deletions.
File renamed without changes.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "boilerplate",
"version": "1.1.4",
"version": "1.1.5",
"description": "Front-end boilerplate for working with react, react-router, postcss, cssnext and webpack + hot reloading",
"main": "webpack.config.js",
"scripts": {
Expand Down Expand Up @@ -28,7 +28,9 @@
"hot",
"reload",
"express",
"server"
"server",
"dev",
"production"
],
"author": "estkin",
"license": "MIT",
Expand All @@ -48,6 +50,7 @@
"eventsource-polyfill": "^0.9.6",
"express": "^4.13.4",
"history": "^2.0.0",
"html-webpack-plugin": "^2.8.1",
"postcss-cssnext": "^2.4.0",
"postcss-import": "^8.0.2",
"postcss-loader": "^0.8.0",
Expand Down
11 changes: 0 additions & 11 deletions public/index_production.html

This file was deleted.

4 changes: 2 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ app.use(require('webpack-dev-middleware')(compiler, {
app.use(require('webpack-hot-middleware')(compiler));

app.get('*', function(req, res) {
res.sendFile(path.join(__dirname, '/public/index_development.html'));
res.sendFile(path.join(__dirname, '/index.html'));
});

app.listen(3000, 'localhost', function(err) {
Expand All @@ -23,5 +23,5 @@ app.listen(3000, 'localhost', function(err) {
return;
}

console.log('Listening at http://localhost:3000');
console.log('devServer is running at http://localhost:3000/');
});
5 changes: 3 additions & 2 deletions webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const webpack = require('webpack');
const autoprefixer = require('autoprefixer');
const cssnext = require('postcss-cssnext');
const impy = require('postcss-import');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
devtool: 'source-map',
Expand All @@ -11,11 +12,11 @@ module.exports = {
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
filename: 'bundle.js'
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new HtmlWebpackPlugin(),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
Expand Down

0 comments on commit c3de411

Please sign in to comment.