0.9.0 • Published 2 years ago

@hugsmidjan/gulp-rollup v0.9.0

Weekly downloads
6
License
ISC
Repository
github
Last release
2 years ago

@hugsmidjan/gulp-rollup

npm install --save-dev @hugsmidjan/gulp-rollup

Usage

const [scripts, scriptsWatch] = require('@hugsmidjan/gulp-rollup')(opts);

API / Advanced usage

const rollupTaskFactory = require('@hugsmidjan/gulp-rollup');

const options = {
  // These are the defaults:
  name: 'scripts', // the display name of the generated tasks
  src: 'src/',
  dist: 'pub/',
  glob: '*.{js,jsx,ts,tsx}', // Glob|Array<Glob> for entry points. Use '!' prefix to ignore
  // entryPoints: null, // Advanced: rollup.input map - overrides the `glob` option
  //                    // Example:  { 'bar/outfile-sans-ext': 'foo/infile.ts' }
  NODE_ENV: process.env.NODE_ENV,
  // plugins: (pluginsArr) => pluginsArr, // Supply your own plugin list
  // replaceOpts: {}, // custom options for @rollup/plugin-replace
  // terserOpts: {}, // custom options for rollup-plugin-terser
  // aliasOpts: {}, // custom options for @rollup/plugin-alias
  // typescriptOpts: {
  //   rawDeclarations: false // true turns off auto-tidying
  //   // custom options for @rollup/plugin-typescript
  // },
  minify: true,
  sourcemaps: true,
  format: 'iife', // Rollup output format
  codeSplit: true, // (kicks in when format isn't 'iife')
  // inputOpts: {},
  // outputOpts: {}, // or Array of option objects
  // watchOpts: {},
};

// If the `options` object isn't flexible enough...
const customConfigger = (rollupConfig) => {
  return {
    ...rollupConfig,
    // Replace or add properties or mutate rollupConfig directly.
  };
};

// Create the gulp tasks based on the above options.
const scriptTasks = rollupTaskFactory(options, customConfigger);

// scriptTasks is a two item array...
const [scripts, scriptsWatch] = scriptTasks;
// ...but it also exposes the tasks as named properties.
const { bundle, watch } = scriptTasks;

TypeScript support.

This task automatically bundles TypeScript files, but it's BYOTS (Bring Your Own TypeScript).

The Typescript plugin is invoked if a tsconfig.json file is detected in/or above the current folder, or via the typescriptOpts.tsconfig option.

It respects ./tsconfig.json, but some compiler options are ignored.

Additionally, compilerOptions.jsx is hard-defaulted to 'react', but it can be overridden via typescriptOpts.jsx.

0.8.4

3 years ago

0.9.0

2 years ago

0.8.3

3 years ago

0.8.2

3 years ago

0.8.1

3 years ago

0.8.0

4 years ago

0.7.2

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.3

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.25

4 years ago

0.3.24

4 years ago

0.3.23

4 years ago

0.3.22

4 years ago

0.3.21

4 years ago

0.3.20

4 years ago

0.3.19

4 years ago

0.3.18

4 years ago

0.4.0-canary.1

4 years ago

0.4.0-canary

5 years ago

0.3.17

5 years ago

0.3.16

5 years ago

0.3.15

5 years ago

0.3.14

5 years ago

0.3.12

5 years ago

0.3.11

5 years ago

0.3.10

5 years ago

0.3.9

5 years ago

0.3.8

5 years ago

0.3.7

5 years ago

0.3.6

5 years ago

0.3.5

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago