Closed stewartwright closed 3 years ago
I'm looking for something similar. Components or partials are required for me in any sort of boilerplate. Is there an easy way to integrate this?
For anyone in the future looking an answer to this problem. There is no need to include additional libraries.
If your partials are in a special folders ignore them in the html-webpack-plugin using the ignore option
from this
const generateHTMLPlugins = () => glob.sync('./src/**/*.html').map((dir) => {
to this
const generateHTMLPlugins = () => glob.sync('./src/**/*.html', { ignore: ['./src/partials/*.html'] }).map((dir) => {
then just use html-loader in your html file
${require('./partials/partial.html')}
@IcepickD This is a great solution. I don't think it should be a part of the core SSB codebase, but I will for sure add this tip to the documentation.
Unable to integrate file-include-webpack-plugin Been trying to get the following working with SSB but can't seem to. https://github.com/Vishal0203/file-include-webpack-plugin
Managed to ignore the files in the partials directory I created however the partials dont merge into the html parents. Any ideas or alternatives appreciated!