All Projects → leogr → rollup-plugin-html-entry

leogr / rollup-plugin-html-entry

Licence: MIT license
Use HTML files as entry points in your rollup bundle.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to rollup-plugin-html-entry

rollup-plugin-lit-css
Moved to https://github.com/bennypowers/lit-css
Stars: ✭ 35 (+169.23%)
Mutual labels:  webcomponents, rollup-plugin
Webpack5-Max
Webpack 5 Boilerplate for JS/React/TS apps.
Stars: ✭ 103 (+692.31%)
Mutual labels:  bundle
webcomponents.dev
Web Components IDE
Stars: ✭ 51 (+292.31%)
Mutual labels:  webcomponents
parcel-plugin-externals
Parcel plugin for declaring externals. These externals will not be bundled. 📦
Stars: ✭ 47 (+261.54%)
Mutual labels:  bundle
SonataTimelineBundle
[Abandoned] Integrates SpyTimelineBundle into Sonata
Stars: ✭ 24 (+84.62%)
Mutual labels:  bundle
grid-bundle
A Symfony2 Ajax Grid
Stars: ✭ 17 (+30.77%)
Mutual labels:  bundle
pattern-library
AXA CH UI component library. Please share, comment, create issues and work with us!
Stars: ✭ 103 (+692.31%)
Mutual labels:  webcomponents
api-viewer-element
API documentation and live playground for Web Components. Based on Custom Elements Manifest format
Stars: ✭ 222 (+1607.69%)
Mutual labels:  webcomponents
LiipSearchBundle
[DEPRECATED] Google XML API for searching is discontinued
Stars: ✭ 35 (+169.23%)
Mutual labels:  bundle
SensioBuzzBundle
No description or website provided.
Stars: ✭ 89 (+584.62%)
Mutual labels:  bundle
gatsby-remark-highlight-code
Adds stylish cards and syntax highlighting to code blocks in markdown files
Stars: ✭ 63 (+384.62%)
Mutual labels:  webcomponents
blurhash-as
Blurhash implementation in AssemblyScript
Stars: ✭ 26 (+100%)
Mutual labels:  rollup-plugin
js-uprtcl
Libraries, tools and modules to create _Prtcl web apps
Stars: ✭ 33 (+153.85%)
Mutual labels:  webcomponents
gulp-rev-versions-bundle
A bundle that allows symfony to get the version of assets versioned with gulp-rev
Stars: ✭ 13 (+0%)
Mutual labels:  bundle
rollup-plugin-stylus-css-modules
A Rollup.js plugin to compile Stylus and inject CSS Modules
Stars: ✭ 15 (+15.38%)
Mutual labels:  rollup-plugin
CentrifugoBundle
📦 Provides communication with web-socket server Centrifugo in Symfony applications.
Stars: ✭ 65 (+400%)
Mutual labels:  bundle
web-monetized-video
experimenting with web monetisation API
Stars: ✭ 15 (+15.38%)
Mutual labels:  webcomponents
aurum
Fast and concise declarative DOM rendering library for javascript
Stars: ✭ 17 (+30.77%)
Mutual labels:  webcomponents
raster-tiles-compactcache
Compact Cache V2 is used by ArcGIS to store raster tiles. The bundle file structure is very simple and optimized for quick access, resulting in improved performance over alternative formats.
Stars: ✭ 49 (+276.92%)
Mutual labels:  bundle
iron-swipeable-pages
[Polymer 1.x] Element that enables switching between different pages by swiping gesture.
Stars: ✭ 51 (+292.31%)
Mutual labels:  webcomponents

Build Status

rollup-plugin-html-entry

Use HTML files as entry points in your rollup bundle. HTML files and HTML imports will be traversed, then all scripts found will be combined. Optionally, write HTML files cleaned of <script>s. This is particularly useful for web components and web applications in general.

<!-- 0.html -->
<script>export const zero = 0;</script>
<!-- 1.html -->
<script>export const one = 1;</script>
<!-- 2.html -->
<script src="2.js"></script>
// 2.js
export const two = 2;
<!-- all-imports.html -->
<link rel="import" href="0.html">
<link rel="import" href="1.html">
<link rel="import" href="2.html">

Using all-imports.html as entry point will yield a bundle with exports for zero, one, and two.

So, this plugin works like rollup-plugin-multi-entry does, but using <script>s contained in HTML files as entry points.

Install

$ npm install [--save-dev] rollup-plugin-html-entry

Usage

This plugin requires at least v0.48.0 of rollup. In rollup.config.js:

import htmlEntry from 'rollup-plugin-html-entry';

export default {
  input: 'test/**/*.html',
  plugins: [htmlEntry()]
};

The input above is the simplest form which simply takes a glob string. You may pass an array of glob strings or an object with one or more of the following options:

export default {
  input: {
    // Arrays of globs to include
    include: ['index.html', 'and/globs/**/*.html'],
    // Arrays of globs to exclude
    exclude: ['excluded-file.html', 'and/globs/*.to.be.excluded.html'],
    // Arrays of globs that should remain external to the bundle
    external: ['lazy-imports.html', 'and/globs/*.to.be.omitted.html']
  }
  // ...
};

By default HTML files will be not written. If output option is present, HTML files stripped of <script>s will be written into specified path.

export default {
  input: 'index.html',
  plugins: [htmlEntry({ output: "build" })]
  // ...
};

Finally, you may not need to export anything from the rolled-up bundle for web applications. In such cases, use the exports: false option like so:

export default {
  input: 'index.html',
  plugins: [htmlEntry({ exports: false })]
};

License

MIT

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].