From 03a94494f3f778ad149830b75cb1d5cba5e106e9 Mon Sep 17 00:00:00 2001 From: Leo7654 Date: Tue, 30 Jan 2024 18:21:47 +0900 Subject: [PATCH] Fix rollup build --- packages/extension/src/content/load.js | 2 +- rollup.config.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/extension/src/content/load.js b/packages/extension/src/content/load.js index 38922f7..02cf9e8 100644 --- a/packages/extension/src/content/load.js +++ b/packages/extension/src/content/load.js @@ -21,7 +21,7 @@ const xhr = new XMLHttpRequest() xhr.onload = () => { const fileName = decodeURIComponent(fileUrl.split('/').pop()) document.title = fileName - new HWP.Viewer(document.body, new Uint8Array(xhr.response), { type: 'array' }) + new HWP(document.body, new Uint8Array(xhr.response), { type: 'array' }) } xhr.open('GET', fileUrl) diff --git a/rollup.config.js b/rollup.config.js index b2861f3..db1e175 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -9,14 +9,17 @@ const rootDirectory = path.join(__dirname) const srcDirectory = path.join(rootDirectory, 'src') const buildDirectory = path.join(rootDirectory, 'build') -const inputFile = path.join(srcDirectory, 'index.ts') +const inputFile = [path.join(rootDirectory, 'packages', 'viewer', 'src', 'index.ts')] const extensions = ['.js', '.mjs', '.ts'] const external = ['fs'] const plugins = [ - resolve({ extensions, skip: ['fs'] }), + resolve({ + extensions, + skip: ['fs'] + }), commonjs(), babel({ extensions, @@ -46,7 +49,7 @@ export default [ input: inputFile, output: [ { - file: path.join(rootDirectory, 'extension', 'content', 'hwp.js'), + file: path.join(rootDirectory, 'packages', 'extension', 'content', 'hwp.js'), format: 'iife', name: 'HWP', },