Skip to content
This repository was archived by the owner on May 25, 2022. It is now read-only.

jsdom and webpack build problems #59

Closed
libertylocked opened this issue Mar 21, 2019 · 4 comments
Closed

jsdom and webpack build problems #59

libertylocked opened this issue Mar 21, 2019 · 4 comments
Labels

Comments

@libertylocked
Copy link
Contributor

In 1.7.0 when running webpack build, the bw.js bundle came with all the dependencies, which is excellent and can be used anywhere nodejs is installed. We can basically run node /usr/lib/bitwarden-cli/bw.js without having to use the binary built by pkg (since it's got a pretty fat nodejs runtime in it).

1.7.1 added jsdom and the webpack config doesn't build external node_modules into the bundle anymore, making it pretty difficult to use standalone.

I tried removing the externals from webpack.conf.js but it had some issue with canvas module not found.

I wonder if it's still possible to build a standalone javascript bundle?

@kspearrin
Copy link
Member

I'm confused. Are you saying that local builds no longer work?

npm install
npm run sub:init
npm run build
cd build
node ./bw.js

@libertylocked
Copy link
Contributor Author

libertylocked commented Mar 21, 2019 via email

@kspearrin
Copy link
Member

kspearrin commented Mar 22, 2019

I see. Yes, webpack-node-externals was added to resolve the canvas issues with using the new jsdom library which supports the import command. See #50

If you can figure out a way to work around those canvas errors, we can revert it. I couldn't.

If you have the node runtime already installed, can't you just install from npm?

npm i -g @bitwarden/cli

@bitwarden-bot
Copy link

Hi libertylocked,
We're cleaning up our repositories in preparation for a major reorganization. Issues from last year will be marked as stale and closed after two weeks. If you still need help, comment to let us know and we'll look into it.
Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants