You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{rollup}from'rollup';importnodeResolvefrom'rollup-plugin-node-resolve-angular';rollup({entry: 'main.js',plugins: [nodeResolve({// use "es2015" field for ES2015 modules with ES2015 code,// if possiblees2015: true,// Default: false// use "module" field for ES2015 modules with ES5 code,// if possiblemodule: true,// Default: true// use "jsnext:main" if possible// – see https://github.com/rollup/rollup/wiki/jsnext:mainjsnext: true,// Default: false// use "main" field or index.js, even if it's not an ES6 module// (needs to be converted from CommonJS to ES6// – see https://github.com/rollup/rollup-plugin-commonjsmain: true,// Default: true// if there's something your bundle requires that you DON'T// want to include, add it to 'skip'. Local and relative imports// can be skipped by giving the full filepath. E.g.,// `path.resolve('src/relative-dependency.js')`skip: ['some-big-dependency'],// Default: []// some package.json files have a `browser` field which// specifies alternative files to load for people bundling// for the browser. If that's you, use this option, otherwise// pkg.browser will be ignoredbrowser: true,// Default: false// not all files you want to resolve are .js filesextensions: ['.js','.json'],// Default: ['.js']// whether to prefer built-in modules (e.g. `fs`, `path`) or// local ones with the same namespreferBuiltins: false// Default: true})]}).then(bundle=>bundle.write({dest: 'bundle.js',format: 'iife'}));// alongside rollup-plugin-commonjs, for using non-ES6 third party modulesimportcommonjsfrom'rollup-plugin-commonjs';rollup({entry: 'main.js',plugins: [nodeResolve({jsnext: true,main: true}),commonjs()]}).then(bundle=>bundle.write({dest: 'bundle.js',moduleName: 'MyModule',format: 'iife'})).catch(err=>console.log(err.stack));
License
MIT
About
Use the Node.js resolution algorithm with Rollup, with new "es2015" support for Angular.