@axew/jugg-plugin-multi-html
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

jugg-plugin-multi-html

Aim to generate multi html files with routes config, which is base on html-webpack-plugin.

config

interface Config {
  routes: Array<{
    // route path
    path: string;
    // assign a specific template path, relative to the `src/`
    template?: string;
  }>;
}

example

// .juggrc.js
export default {
  plugins: [
    [
      '@axew/jugg-plugin-multi-html',
      {
        routes: [
          {
            path: '/user',
            template: './documents/user.ejs'
          },
          {
            path: '/user/profile',
            template: './documents/profile.ejs'
          }
        ]
      }
    ]
  ]
}

After building.

# dist/
.
├── index.f4bf6a3f58833a69beb9.js
├── index.html
└── user
    ├── index.html
    └── profile
        └── index.html

Notice

  • When publichPath is a relative path, assets path in html is not right.

Readme

Keywords

none

Package Sidebar

Install

npm i @axew/jugg-plugin-multi-html

Weekly Downloads

2

Version

0.0.7

License

MIT

Unpacked Size

6 kB

Total Files

6

Last publish

Collaborators

  • daief