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', },