rollup-plugin-inline-js

2019-11-22 admin

rollup-plugin-inline-js是什么

什么是rollup-plugin-inline-js,Rollup with inline-js

rollup-plugin-inline-js使用教程帮助文档

rollu-plugin-inline-js

Build Status Coverage Status install size

Rollup with inline-js. This might be useful if you build the source with rollup and want to inline some static assets at build-time.

Installation

npm install -D rollup-plugin-inline-js

Usage

import inline from "rollup-plugin-inline-js";

export default {
  input: "entry.js",
  output: {
    file: "dist/output.js",
    format: "es"
  },
  plugins: [inline()]
};

This plugin would replace $inline directives in the source, just like inline-js.

Configuration

The .inline.js config file works as intended.

API

This module exports a single function.

createPlugin

const plugin = createPlugin({
  include?: Array<String>,
  exclude?: Array<String>,
  inlineOptions?: Object
});

Create the plugin instance.

include - a list of glob patterns. The plugin would only process matched files. Default to process all files.

exclude - a list of glob patterns. The plugin would ignore matched files. Default: [].

The inlineOptions object would be passed to createInliner function.

Changelog

  • 0.4.0 (Jun 6, 2019)

    • Bump dependencies. Upgrade to rollup@1.14.1.
    • Fix: remove deprecated dependencies array.
  • 0.3.0 (Aug 5, 2018)

    • The plugin had been rewritten and it works in a different way.
    • The plugin now transform the source file. So now you can write $inline directives in the source file just like using inline-js CLI.
  • 0.2.1 (Jul 22, 2018)

    • Fix: exclude useless stuff in the package.
  • 0.2.0 (Jul 22, 2018)

    • Update dependencies. node.js@8.x, rollup@>=0.61, inline-js-core@0.4.x.
  • 0.1.0 (Dec 28, 2017)

    • First release.

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-79691.html

文章标题:rollup-plugin-inline-js

回到顶部