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

Documentation improvement and examples request #135

Open
incompletude opened this issue Sep 26, 2018 · 0 comments
Open

Documentation improvement and examples request #135

incompletude opened this issue Sep 26, 2018 · 0 comments

Comments

@incompletude
Copy link

incompletude commented Sep 26, 2018

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 });
};

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

No branches or pull requests

1 participant