All Projects → cebor → rollup-plugin-angular

cebor / rollup-plugin-angular

Licence: MIT License
Angular2 template and styles inliner

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to rollup-plugin-angular

termy-the-terminal
Web-based terminal powered by React
Stars: ✭ 43 (+186.67%)
Mutual labels:  rollup
rollup-lib-bundler
Simple lib bundler
Stars: ✭ 13 (-13.33%)
Mutual labels:  rollup
svelte-credit-card
A svelte component to render a credit card 💳
Stars: ✭ 30 (+100%)
Mutual labels:  rollup
rollup-plugin-purs
Bundles PureScript modules with Rollup
Stars: ✭ 71 (+373.33%)
Mutual labels:  rollup
wasi-worker
WASM / WASI interface for browser service workers
Stars: ✭ 31 (+106.67%)
Mutual labels:  rollup
svelte-typescript-rollup
Svelte + Typescript + Rollup
Stars: ✭ 79 (+426.67%)
Mutual labels:  rollup
rollup-plugin-istanbul
Seamless integration between Rollup and Istanbul
Stars: ✭ 39 (+160%)
Mutual labels:  rollup
unplugin
Unified plugin system for Vite, Rollup, Webpack, and more
Stars: ✭ 998 (+6553.33%)
Mutual labels:  rollup
rolldown
Modern bundler built on Rollup with couple more features, such as multiple entry points, presets, better configuration experience and more.
Stars: ✭ 17 (+13.33%)
Mutual labels:  rollup
urley
📦 An easy cross-platform utility library to work with URLs in Javascript.
Stars: ✭ 14 (-6.67%)
Mutual labels:  rollup
eleventy-chirpy-blog-template
Blog template for 11ty based on Chirpy UX
Stars: ✭ 37 (+146.67%)
Mutual labels:  rollup
es-aux
JavaScript开发辅助,包含了开发过程中很多场景需要用到的函数。
Stars: ✭ 22 (+46.67%)
Mutual labels:  rollup
markushatvan.com
Personal website and blog written from scratch with SvelteKit and TailwindCSS.
Stars: ✭ 82 (+446.67%)
Mutual labels:  rollup
angular-rollup-starter
Angular2 & Rollup.js including AoT and Universal Prerendering
Stars: ✭ 33 (+120%)
Mutual labels:  rollup
postcss-font-grabber
A postcss plugin, it grabs remote font files and update your CSS, just like that.
Stars: ✭ 26 (+73.33%)
Mutual labels:  rollup
angular-gulp-starter
Simple dev/prod build for Angular (2+) using gulp, systemjs, rollup, ngc (AOT), scss, Visual Studio
Stars: ✭ 18 (+20%)
Mutual labels:  rollup
monoreact
📦 React workspaces implementation
Stars: ✭ 13 (-13.33%)
Mutual labels:  rollup
rollup-plugin-svelte-hot
Fork of official rollup-plugin-svelte with added HMR support (for both Nollup or Rollup)
Stars: ✭ 49 (+226.67%)
Mutual labels:  rollup
buble-react-rollup-starter
A simple starter project to build cool React applications with Bublé and Rollup.
Stars: ✭ 73 (+386.67%)
Mutual labels:  rollup
optimism
The Optimism monorepo
Stars: ✭ 884 (+5793.33%)
Mutual labels:  rollup

Build Status

rollup-plugin-angular

Angular2 template and styles inliner for rollup

Looking for new maintainer

I have no time to maintain this plugin anymore. So im looking for a new Maintainer. Feel free to create an issue, when you want to maintain this plugin.

Installation

npm install --save-dev rollup-plugin-angular

Example

// rollup.config.js
import angular from 'rollup-plugin-angular';
import typescript from 'rollup-plugin-typescript';
import alias from 'rollup-plugin-alias';
import nodeResolve from 'rollup-plugin-node-resolve';

export default {
  entry: 'src/main.ts',
  format: 'iife',
  dest: 'dist/bundle.js',
  plugins: [
    angular(),
    typescript(),
    alias({ rxjs: __dirname + '/node_modules/rxjs-es' }), // rxjs fix (npm install rxjs-es)
    nodeResolve({ jsnext: true, main: true })
  ]
}

Template & Style preprocessing

You may need to do some preprocessing on your templates & styles such as minification and/or transpilation.

To do this you can pass a preprocessors object as an option, containing a style and/or template preprocessor.

If you are using rollup on a source that has already been transpiled to JavaScript you will also need to set the sourcetype.

Signature

sourcetype: 'js' //defaults to 'ts'
preprocessors: {
  template: (source: string, path: string) => string,
  style: (source: string, path: string) => string,
}

source - The contents of the style or template's file.

path - The path to the loaded file. Can be useful for checking file extensions for example.

returns the manipulated source as a string.

Example

The following example shows how you can use sass, clean-css (for css minification), and htmlmin.

// rollup.config.js
import angular from 'rollup-plugin-angular';
import typescript from 'rollup-plugin-typescript';
import nodeResolve from 'rollup-plugin-node-resolve';
import sass from 'node-sass';
import CleanCSS from 'clean-css';
import { minify as minifyHtml } from 'html-minifier';

const cssmin = new CleanCSS();
const htmlminOpts = {
    caseSensitive: true,
    collapseWhitespace: true,
    removeComments: true,
};

export default {
  input: 'src/main.ts',
  output: {
    format: 'umd',
    file: 'dist/bundle.js'
  },
  plugins: [
    angular({
      // additional replace `templateUrl` and `stylesUrls` in every `.js` file
      // default: true
      replace: false, 
      preprocessors: {
        template: template => minifyHtml(template, htmlminOpts),
        style: scss => {
            const css = sass.renderSync({ data: scss }).css;
            return cssmin.minify(css).styles;
        },
      }
    })
    typescript(),
    nodeResolve({ jsnext: true, main: true })
  ]
}
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].