Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

enhance webpack config for html and css files #32

Open
wants to merge 1 commit into
base: substrate-node-template
Choose a base branch
from
Open

enhance webpack config for html and css files #32

wants to merge 1 commit into from

Conversation

dt665m
Copy link

@dt665m dt665m commented Apr 22, 2019

This is a proposed enhancement to #30 to make the template a bit more customizable and platform agnostic. Overview of changes:

  • index.html moved to /public
  • copied styles.css to /src/styles
  • webpack-config.js modifications for html and css file changes
  • delete "dist" symlink (which should now respect the .gitignore entry for dist)
  • moved url-loader, style-loader and css-loader to devDependencies
  • added html-webpack-plugin to devDependencies
  • changed "Gav's Substrate UI" to "Substrate UI" in package.json and index.html

@parity-cla-bot
Copy link

It looks like @dt665m hasn't signed our Contributor License Agreement, yet.

The purpose of a CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen licence.
Wikipedia

You can read and sign our full Contributor License Agreement at the following URL: https://cla.parity.io

Once you've signed, please reply to this thread with [clabot:check] to prove it.

Many thanks,

Parity Technologies CLA Bot

@dt665m
Copy link
Author

dt665m commented Apr 22, 2019

[clabot:check]

@parity-cla-bot
Copy link

It looks like @dt665m signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

@shawntabrizi
Copy link
Contributor

@dt665m sorry for taking a while to get to this.

It does not seem this quite satisfies all the requirements of a solution. Specifically it does not update the docs folder so that the GitHub pages is up to date.

Could a solution here be:

  • Update GitHub pages config to use the root folder rather than docs
  • Have the index.html file be in the root folder
  • Have the index.html file reference the js files in the dist folder
  • Remove docs folder and reintroduce dist into the project, removing it from .gitignore

Then yarn run dev will generate dist content, and when we push, GitHub pages stays up to date.

@dt665m
Copy link
Author

dt665m commented Apr 29, 2019

@shawntabrizi, I didn't get the clue that docs was used for Github Pages, but now the symlink makes a lot more sense. We usually do Github Pages using an explicit gh-pages branch. Sorry for missing this.

What do you think about adding an explicit "docs" script in package.json that copies over the necessary files into the current docs folder? The flow would be:

  • Make code changes
  • yarn build && yarn docs
  • git add/commit/push

The docs script could also be made to run after every build automatically to guard against forgetting to run the docs command before checking in.

I'm happy to fix it with your solution as well but it'll be harder for me to test as I don't have access to the project so I can't really see the github pages changes or modify it to run index.html from root. My opinion is builds should not be checked in and docs/gh-pages should be explicitly updated. Cheers!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants