When used as a dependency and then bundled w/ Webpack (and probably Rollup), the bundler tries to rope in fs and jsdom. Since the bundle is for a browser, these dependencies are invalid.
The mocks in the browser directory only seem to help with creating a browser distro, but not when used as a dependency via npm and then bundled for a browser distro.
As such, I might need to rethink how to use those dependencies.
As a workaround for Webpack, use the IgnorePlugin:
plugins: [
new webpack.IgnorePlugin(
/(fs|jsdom)/,
/thymeleaf/
)
]
I'm sure it's roughly the same workaround with Rollup and rollup-plugin-ignore.
When used as a dependency and then bundled w/ Webpack (and probably Rollup), the bundler tries to rope in
fs
andjsdom
. Since the bundle is for a browser, these dependencies are invalid.The mocks in the browser directory only seem to help with creating a browser distro, but not when used as a dependency via npm and then bundled for a browser distro.
As such, I might need to rethink how to use those dependencies.
As a workaround for Webpack, use the IgnorePlugin:
I'm sure it's roughly the same workaround with Rollup and rollup-plugin-ignore.