@foxitsoftware/addon-loader
v0.7.4
Published
UIExtension(Foxit PDF SDK for Web)'s addon loader module for webpack.
Downloads
1,178
Maintainers
Keywords
Readme
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
})