0.2.4 • Published 5 years ago

rollup-plugin-includepaths v0.2.4

Weekly downloads
12,692
License
MIT
Repository
github
Last release
5 years ago

rollup-plugin-includepaths

Let you use relative paths in your import directives, like this:

// from src/lib/one/foo.js
import { Foo } from 'one/foo';

// from src/other/two/bar.js
import { Bar } from 'two/bar';

Setup

In your rollup configuration file:

import includePaths from 'rollup-plugin-includepaths';

let includePathOptions = {
    include: {},
    paths: ['src/lib', 'src/other'],
    external: [],
    extensions: ['.js', '.json', '.html']
};

export default {
    entry: './app.js',
    format: 'cjs',
    dest: 'public/app.min.js',
    plugins: [ includePaths(includePathOptions) ],
};

Options:

paths = ['']

An array of source paths in your project where the plugin should look for files

Example: ['src/lib', 'src/foo']

By default, resolve files from working dir

include

A map of module=>path/to/file.js with custom module paths. Used to override the search with a static path (like Browserify does with the "browser" config).

Use this option if you want to skip the file resolution and directly resolve a module name to a given path.

Example:

include: {
    // Import example: import angular from 'angular';
    'angular': 'bower_components/angular/angular.js'
}

external

An array of module names that should be excluded from the bundle (external modules).

By default, all the node built-in modules will be marked as external.

To include the built-ins, you can use the builtins plugin and set this config to an empty array.

Example:

// will not include the module 'angular' in the final bundle
external: ['angular']

extensions

An array of file extensions to look for in the project.

Default: ['.js', '.json']

mindee-sdk-react@outwalk/sable@jleeson/toolchain-javascript@jleeson/toolchain-typescriptplanz-uikit-mjtinbox@infinitebrahmanuniverse/nolb-rollup-plugin-i@everything-registry/sub-chunk-2680@zxventures/courier-design-systemswdewidjet-test-utilsvitrailjspicl-clijs-in-jsonlarge-data-tableuiwiwidgettest-components-yxtln-test-pkg@diekoders/resourcesyunxi-antd-tablexstate-tools@groceristar/sd-wrapper@hduy/pkg@kzaytsev/common-components@loriensleafs/dom@loriensleafs/marionette-animated-region@networkteam/gulpfile@nijor/cli@fabiog/ddatepicker@mdhnpm/react-mdh-blog-components@hyperloop-upv/common-front@quentin_widlocher/jspicl-cli@redsift/redsift-bundler@nys-cui/cui-nys@nys-cui/cui-clipagerender-ngnwt-gulpfilerollup-dyc-demorollup-react-appreact-open-formneocast_api_utilsplanz-uikitplanz-uikit-hjpure-enginesibur-common-componentsgulp-build-tools-tshexo-plugin-rollupheremap-tsinstaller-basicledemama-noodlemarionette-animated-region-cssanimatormarionette-animated-region-jsanimatormarionette-animatormarionette-animator-cssplayermarionette-animator-jsplayerllm-playground-chainmayihr-business-componentsmayihr-componentsmayihr-components-mobilemayihr-ldcpmayihr-login-componentsmetalbox@webreflection/hydra@vimesh/portlet-plugin-vue@visual-framework/vf-sass-compilation@visual-framework/vf-demo-desing-system@vitrail/plugin-typescript@stromboli/plugin-rollup@taho2509/rock-common-uia14-tableb14-tablecodemocreate-mashup-appcourier-design-systemcui-nysblacklight-oembedbuild_rollupbs-ad-builderember-cli-webcomponents-bundlerfiori-design-react
0.2.4

5 years ago

0.2.3

7 years ago

0.2.2

8 years ago

0.1.8

8 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.7

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago