-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
Due to the way that environments are detected it is difficult to use from Webpack, as both Node is detected (thus requiring fs and ws) and window is detected (thus not exporting to module.exports). Those issues can be worked around using imports-loader and exports-loader, but it would probably be nice to have a way to detect Webpack and "just work" OOTB.
I was capable of using [email protected] using the following configuration:
module.exports = {
mode: 'production',
…
node: {
// required by xmllint (but not really used in the browser)
fs: 'empty',
},
externals: {
// required by xmllint (but not really used in the browser)
ws: '{}',
},
module: {
rules: [{
test: path.resolve(__dirname, 'node_modules/xmllint/xmllint.js'),
use: [
'imports-loader?require=>null',
'exports-loader?xmllint'
]
}],
},
};
```jloewe, kondr1, massadigital and philipsens
Metadata
Metadata
Assignees
Labels
No labels