-
Notifications
You must be signed in to change notification settings - Fork 33
Update readme.md for use with Webpack 5 #24
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
module.exports = { | ||
webpack: { | ||
configure:{ | ||
// See https://github.com/webpack/webpack/issues/6725 | ||
module:{ | ||
configure: { | ||
module: { | ||
rules: [{ | ||
test: /\.wasm$/, | ||
type: 'javascript/auto', | ||
}] | ||
} | ||
} | ||
} | ||
use: [{ loader: 'file-loader' }] | ||
}], | ||
}, | ||
resolve: { | ||
fallback: { | ||
'path': require.resolve('path-browserify'), | ||
'crypto': require.resolve('crypto-browserify'), | ||
'stream': require.resolve('stream-browserify') | ||
Comment on lines
+13
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we actually use path, crypto and stream anywhere ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that a good question, and honestly I don"t really know how webpack handle wasm, nor how sql.js is built. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably avoid encouraging users to bundle three dependencies they don't need with their code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In addition to config.resolve.fallback = {
'fs': false,
'path': false,
'crypto': false,
'stream': false
} Edit: This seems to be working for my other repository using TypeORM + Sql.js + Expo Web! Requires further testing on React + Sql.js though I believe it should work the same. |
||
} | ||
}, | ||
}, | ||
}, | ||
}; |
Uh oh!
There was an error while loading. Please reload this page.