Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack Only #138

Merged
merged 15 commits into from Dec 3, 2018

Conversation

@walexnelson
Copy link
Contributor

walexnelson commented Nov 15, 2018

- Summary

Removes Gulp in favor of Webpack + NPM scripts. Also added support for optional Sass stylesheets (CSS is still OK). There are a few vulnerabilities in Gulp when you run npm audit (see #122 ) and IMO there's no need to have another pipeline in addition to Webpack. Webpack + Webpack Dev Server does everything that Gulp was doing. Running hugo-bin in a parallel script and now you have watch mode on both the HTML and the js/CSS side.

- Test plan

  • Ran it locally with npm start to test that HMR worked.
  • Ran npm run preview to test the unpublished articles
  • Ran npm run build and tested that the assets built correctly locally (ran serve ./dist)
  • Ran npm run build:preview to make sure it worked
  • Deployed the branch to netlify to make sure the config was still correct: https://practical-franklin-15ffb2.netlify.com/

- Description for the changelog

Replace Gulp with Webpack + NPM. Optional Sass support

i think it works

@walexnelson

This comment has been minimized.

Copy link
Contributor Author

walexnelson commented Nov 15, 2018

have more work to do

@walexnelson walexnelson reopened this Nov 15, 2018
@walexnelson

This comment has been minimized.

Copy link
Contributor Author

walexnelson commented Nov 15, 2018

Ok, had to add some things to better support other pages. I'm a relative novice to Hugo so I might not be considering some of the more advanced stuff - but it seems to work fine with the simple projects I have set up.

@erquhart

This comment has been minimized.

Copy link
Contributor

erquhart commented Nov 26, 2018

Haven't forgotten about this - really hoping to see someone test it out with real production requirements before merging.

site/config.toml Outdated Show resolved Hide resolved

This is a boilerplate for using [Hugo](https://gohugo.io/) as a static site generator and [Webpack](https://webpack.js.org/) as your asset pipeline. Victor Hugo setup to use [PostCSS](http://postcss.org/) and [Babel](https://babeljs.io/) for CSS and JavaScript compiling/transpiling. This project is released under the [MIT license](LICENSE). Please make sure you understand its implications and guarantees.

## Enjoy!! 😸

This comment has been minimized.

Copy link
@erquhart

erquhart Nov 27, 2018

Contributor

This is cool, thanks for adding it!

This comment has been minimized.

Copy link
@walexnelson

walexnelson Dec 1, 2018

Author Contributor

No problem. I wanted to make sure content was getting handled correctly so I added a few pages - figured this might be worth keeping.

src/index.js Show resolved Hide resolved

module.exports = {
entry: {
main: path.join(process.cwd(), "src/index.js")

This comment has been minimized.

Copy link
@erquhart

erquhart Nov 27, 2018

Contributor

process.cwd() is the default context, so you can just use the relative paths for both entry and output.

This comment has been minimized.

Copy link
@walexnelson

walexnelson Dec 1, 2018

Author Contributor

I forgot webpack requires abs paths, so I updated it to use the pattern from master path.join(__dirname, "src", "index.js")

@erquhart

This comment has been minimized.

Copy link
Contributor

erquhart commented Nov 27, 2018

@walexnelson a couple of change requests in my comments above. After that, I may just go ahead and merge. Great work, thank you!

@walexnelson

This comment has been minimized.

Copy link
Contributor Author

walexnelson commented Nov 28, 2018

Thanks @erquhart I'll make those changes in the next day or two, as soon as I get a free minute.

Alex Nelson added 3 commits Dec 1, 2018
Alex Nelson
Alex Nelson
Alex Nelson
@erquhart

This comment has been minimized.

Copy link
Contributor

erquhart commented Dec 3, 2018

The new placeholder page looks awesome too - great work on all of this!

@erquhart erquhart merged commit c2e09f4 into netlify-templates:master Dec 3, 2018
6 checks passed
6 checks passed
Header rules - victor-hugo-template No header rules processed
Details
Pages changed - victor-hugo-template All files already uploaded
Details
Redirect rules - victor-hugo-template No redirect rules processed
Details
Mixed content - victor-hugo-template No mixed content detected
Details
deploy/netlify Deploy preview ready!
Details
netlify/victor-hugo-template/deploy-preview Deploy preview ready!
Details
@ajonp

This comment has been minimized.

Copy link

ajonp commented Dec 4, 2018

This totally threw me for a curveball...lol. I just got everything setup to use Gulp 💃

@erquhart

This comment has been minimized.

Copy link
Contributor

erquhart commented Dec 4, 2018

You still can! Just don't pull down the latest commit.

Sent with GitHawk

bep added a commit to gohugoio/hugoDocs that referenced this pull request Mar 25, 2019
@walexnelson walexnelson deleted the walexnelson:feature/webpack-only branch Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.