All Projects → zorigitano → Multipage Webpack Plugin

zorigitano / Multipage Webpack Plugin

Licence: apache-2.0
A plugin that makes handling templates and asset distribution for multi-page applications using webpack trivial

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Multipage Webpack Plugin

Webpack Cdn Plugin
A webpack plugin that use externals of CDN urls for production and local node_modules for development
Stars: ✭ 306 (+82.14%)
Mutual labels:  webpack, webpack2, webpack-plugin
Svg Sprite Loader
Webpack loader for creating SVG sprites.
Stars: ✭ 1,822 (+984.52%)
Mutual labels:  webpack, webpack2, webpack-plugin
Html Res Webpack Plugin
plugin for generating html in webpack
Stars: ✭ 170 (+1.19%)
Mutual labels:  webpack, webpack2, webpack-plugin
Browser Sync Webpack Plugin
Easily use BrowserSync in your Webpack project.
Stars: ✭ 356 (+111.9%)
Mutual labels:  webpack, webpack2, webpack-plugin
Webpack Alioss Plugin
阿里 oss-webpack 自动上传插件
Stars: ✭ 35 (-79.17%)
Mutual labels:  webpack, webpack2, webpack-plugin
Everything Is A Plugin
Everything is a Plugin: Mastering webpack from the inside out. NgConf 2017
Stars: ✭ 123 (-26.79%)
Mutual labels:  webpack, webpack2, webpack-plugin
Webpack Core Usage
webpack2完整系列课程,欢迎阅读。同时欢迎移步我的react全家桶文章全集: https://github.com/liangklfangl/react-article-bucket
Stars: ✭ 94 (-44.05%)
Mutual labels:  webpack, webpack2, webpack-plugin
Webpack.js.org
Repository for webpack documentation and more!
Stars: ✭ 2,049 (+1119.64%)
Mutual labels:  webpack, webpack2, webpack-plugin
Webpack2
基于webpack2和vue.js2构建饿了么多页面应用 🌹
Stars: ✭ 165 (-1.79%)
Mutual labels:  webpack, webpack2
Webpack Require From
Webpack plugin that allows to configure path or URL for fetching dynamic imports
Stars: ✭ 142 (-15.48%)
Mutual labels:  webpack, webpack-plugin
Worker Plugin
👩‍🏭 Adds native Web Worker bundling support to Webpack.
Stars: ✭ 1,840 (+995.24%)
Mutual labels:  webpack, webpack-plugin
Size Plugin
Track compressed Webpack asset sizes over time.
Stars: ✭ 1,665 (+891.07%)
Mutual labels:  webpack, webpack-plugin
Obsolete Webpack Plugin
🌈 A Webpack plugin generates a browser-side standalone script that detects browser compatibility based on `Browserslist` and prompts website users to upgrade it.
Stars: ✭ 148 (-11.9%)
Mutual labels:  webpack, webpack-plugin
Iceberg
Front-End Boilerplate built with React + Babel + Webpack + SASS
Stars: ✭ 144 (-14.29%)
Mutual labels:  webpack, webpack2
React Webpack Rails Tutorial
Example of integration of Rails, react, redux, using the react_on_rails gem, webpack, enabling the es7 and jsx transpilers, and node integration. And React Native! Live Demo:
Stars: ✭ 1,669 (+893.45%)
Mutual labels:  webpack, webpack2
React Redux Styled Hot Universal
react boilerplate used best practices and focus on performance
Stars: ✭ 147 (-12.5%)
Mutual labels:  webpack, webpack2
Webpack Visualizer
Visualize your Webpack bundle
Stars: ✭ 1,664 (+890.48%)
Mutual labels:  webpack, webpack-plugin
Bundle Stats
In-depth bundle analyzer for webpack(bundle size, assets, modules, packages)
Stars: ✭ 144 (-14.29%)
Mutual labels:  webpack, webpack-plugin
Virtual Module Webpack Plugin
Adds the contents of a virtual file to webpack's cached file system without writing it to disk
Stars: ✭ 165 (-1.79%)
Mutual labels:  webpack, webpack-plugin
Webpack Babel Multi Target Plugin
A Webpack plugin that works with Babel to allow differential loading - production deployment of ES2015 builds targeted to modern browsers, with an ES5 fallback for legacy browsers.
Stars: ✭ 150 (-10.71%)
Mutual labels:  webpack, webpack-plugin

multipage-webpack-plugin

Build Status Coverage Status

webpack plugin that allows for trivial configuration for multi page web applications

Problem

Currently to architect a webpack configuration for multi page web applications, there are many requirements for managing all assets and entry points.

  • In a multipage application every rendered page corresponds to a webpack entry point.

  • Each entry point will have some sort of index.html file or a MVC framework specific server template (partial) which renders to html content.

    • May have different paths, may not even be in the same directory as the entry point.
    • Should contain just the assets bundled for that entry.
    • You would have to create essentially a html-webpack-plugin for each entry however posses extra configuration challenges:

    An example for a Laravel 4 Application using Twig Templates

    const templatesFn = (modules, twigRoot, assetsRoot, shared) => {
      return Object.keys(modules).map((entryName) => {
        return new HtmlWebpackPlugin({
          template: `${assetsRoot}/webpack.template.hbs`, //path.resolve(__dirname, "./assets/webpack.template.hbs"),
          filename: `${twigRoot}/webpack-bundles/${entryName}.twig`,
          chunks: ['inline', 'vendors', entryName, `${shared}`]
        })
      });
    } 
    

Development

  • npm install

Single Test Build

  • npm t

Test Watch

  • npm run test:watch

Usage [WIP]

Plugin Options [WIP]

sharedChunkName vendorChunkName inlineChunkName templateFilename templatePath htmlTemplatePath

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].