webpack-node-externals
webpack-node-externals copied to clipboard
How can I bundle assets (i.e css files) from node_modules that required in node_modules?
Hi, i use example from here:
https://github.com/liady/webpack-node-externals#how-can-i-bundle-required-assets-ie-css-files-from-node_modules
But looks like it works only when css file import places at source code of project
It is not working when i import file from node_modules that imports css file
How can i fix that?
Example of source code:
// import css WORKS
import "./test.css";
// import css-modules WORKS
import styles from "./test.module.css";
// import css-modules from node_modules WORKS
import somethingStyles from "some-lib/something/something.module.scss";
// import module from node_modules that has imports of css-modules ERROR
import { Something } from "some-lib/something";
Example of webpack config:
{
target: 'node',
externalsPresets: { node: true },
externals: nodeExternals({
allowlist: [/\.(?!(?:js|json)$).{1,5}$/i],
}),
// ...
}
I am having similar issue with 'react-day-picker' v7