Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rollup build #87

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/extension/src/content/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 6 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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',
},
Expand Down