@foxitsoftware/addon-loader

0.7.4 • Public • Published

addon-loader

A loader for webpack to preprocess Foxit PDF SDK for Web UIExtension addons.

Getting Started

To begin, you'll need to install our addon-loader:

npm i -D @foxitsoftware/addon-loader

Configure webpack.config.js

module.exports = {
    module: {
        rules: [{
            test: /\.css$/,
            loader: ['style-loader', 'css-loader'] // resolve css resource in addon
        },{
            test: /addon.info.json/,
            use: [{
                loader: 'babel-loader',
                options: {
                    "presets": ["@babel/preset-env"]
                }
            }, '@foxitsoftware/addon-loader'],
            type: 'javascript/auto'
        }]
    },
   externals: ['PDFViewCtrl']
};

Import in index.js

import HContinuousAddon from 'path/to/sdk/lib/uix-addons/h-continuous/addon.info.json';
import UIExtension from 'path/to/sdk/lib/UIExtension.full.js';

new UIExtension.PDFUI({
    addons: [
        HContinuousAddon
    ],
    // ignored other irrelevant options
})

Readme

Keywords

none

Package Sidebar

Install

npm i @foxitsoftware/addon-loader

Weekly Downloads

205

Version

0.7.4

License

ISC

Unpacked Size

5.69 kB

Total Files

3

Last publish

Collaborators

  • cheng_lin
  • jianxin_yang
  • xuexing-he
  • tianwei_wu_foxit
  • hong_lin
  • albanomoura
  • rowanhanna
  • xinqiang_song
  • lzw4x
  • yongliang_huang
  • jim2018
  • foxitsdk
  • foxitniu
  • cancerq
  • linc0803
  • web-sdk-ci
  • webviewer
  • warerwang
  • zhiquan_ye
  • y1j2x34