Skip to content

Documentation improvement and examples request  #135

Description

@incompletude

Hey guys, thank you for all the nice work.

I'm trying to use static-site-generator-webpack-plugin to build a pagination based on locals data. I think the way to go is use ejs templates and locals properties, but I'm not really sure how to put it together.

It would be nice to have an examples folder (not only React ones, please! JAMStack it is!) and an improved documentation for assets and templates.

Thank you.


I'm not using React. I have added the following code to my index.js and a template.ejs file inside the src folder, but I'm not sure how to put it together because I'm getting You may need an appropriate loader to handle this file type.

Should I have ejs-loader?

var template = require("./template.ejs");

export default data => {
    const assets = Object.keys(data.webpackStats.compilation.assets);
    const css = assets.filter(value => value.match(/\.css$/));
    const js = assets.filter(value => value.match(/\.js$/));
    return template({ css, js, ...data });
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions