Update dependencies and add a short README

This commit is contained in:
Mathias Biilmann Christensen 2016-07-05 11:38:18 -07:00
parent 8f6c70c51b
commit a6a5d841fd
5 changed files with 55 additions and 10 deletions

View File

@ -1,3 +1,7 @@
{
"presets": ["es2015"]
"presets": ["es2015"],
"plugins": [
"syntax-object-rest-spread",
"transform-object-rest-spread"
]
}

33
README.md Normal file
View File

@ -0,0 +1,33 @@
# Hugo + Webpack Boilerplate
This is a boilerplate for using Hugo as a static site generator and Weback as the
asset pipeline.
It's setup to use post-css and babel for CSS and JavaScript.
## Usage
Clone this repository and run:
```bash
npm install
npm start
```
Then visit http://localhost:3009/
To build your static output, use:
```bash
npm run build
```
## Deploying to netlify
Push your clone to your own GitHub repo, then start a new netlify project, pick
your repository and configure it like this:
* **Build Command:** npm run build
* **Directory:** dist
Now netlify will build and deploy your site whenever you push to git.

View File

@ -42,11 +42,18 @@ gulp.task('server', ['build'], (cb) => {
// Start a webpack-dev-server
new WebpackDevServer(webpack(myConfig), {
contentBase: './dist',
publicPath: 'http://localhost:3009/',
publicPath: '/',
stats: {
colors: true
},
hot: false
hot: false,
proxy: {
"/confirm/*": {
bypass: function(req, res, proxyOptions) {
return "/pages/confirm/index.html";
}
}
}
}).listen(3009, 'localhost', function(err) {
if(err) throw new gutil.PluginError('webpack-dev-server', err);
gutil.log('[webpack-dev-server]', 'http://localhost:3009/');

View File

@ -19,9 +19,12 @@
"babel-plugin-transform-object-rest-spread": "^6.8.0",
"babel-preset-es2015": "^6.9.0",
"css-loader": "^0.23.1",
"exports-loader": "^0.6.3",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.9.0",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
"imports-loader": "^0.6.5",
"postcss-cssnext": "^2.7.0",
"postcss-loader": "^0.9.1",
"style-loader": "^0.13.1",

View File

@ -1,5 +1,6 @@
import webpack from 'webpack';
import path from 'path';
import ExtractTextPlugin from "extract-text-webpack-plugin";
export default {
module: {
@ -11,17 +12,13 @@ export default {
{ test: /\.json$/, loader: 'json-loader' },
{
test: /\.css$/,
loader: 'style!css?modules!postcss'
loader: ExtractTextPlugin.extract("style", "css?importLoaders=1!postcss")
},
{
loader: 'babel',
test: /\.js?$/,
exclude: /node_modules/,
query: {
cacheDirectory: true,
presets: ['react', 'es2015'],
plugins: ['transform-class-properties', 'transform-object-assign', 'transform-object-rest-spread']
}
query: {cacheDirectory: true}
}
]
},
@ -33,7 +30,8 @@ export default {
plugins: [
new webpack.ProvidePlugin({
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
})
}),
new ExtractTextPlugin("main.css")
],
context: path.join(__dirname, 'src'),