Skip to content

Commit

Permalink
Prevent the externalization of styles from the node_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Norserium committed Aug 16, 2022
1 parent 1b3357e commit a92b568
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-advanced-cropper",
"version": "0.10.2",
"version": "0.10.4",
"description": "The react cropper library that gives the possibility to create croppers exactly suited for your website design",
"author": "Norserium",
"license": "MIT",
Expand Down
7 changes: 6 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ const bundles = [
},
];

export function excludedFromBundle(dependency) {
// Exclude all dependencies inside node_modules from the bundle, except the styles
return /node_modules/.test(dependency) && !/\.s?css$/.test(dependency);
}

export default bundles.map(({ format, bundle, file }) => ({
input: 'src/index.ts',
output: {
Expand All @@ -40,7 +45,7 @@ export default bundles.map(({ format, bundle, file }) => ({
},
sourcemap: true,
},
external: bundle ? [/node_modules/] : ['react'],
external: bundle ? excludedFromBundle : ['react'],
plugins: [
scss({
output: 'dist/style.css',
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1864,10 +1864,10 @@ address@^1.0.1:
resolved "https://registry.yarnpkg.com/address/-/address-1.1.2.tgz#bf1116c9c758c51b7a933d296b72c221ed9428b6"
integrity sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA==

advanced-cropper@0.8.2:
version "0.8.2"
resolved "https://registry.yarnpkg.com/advanced-cropper/-/advanced-cropper-0.8.2.tgz#97796601da5b87a752d9498a4f57cc3596b08a52"
integrity sha512-vgMeqsSRx4Skx7pO4YsDsY12HUkueGk5P7OswOp8kuRTDW9eilpIwro6A41uJh/eu2QZ2UC/8vyTX6SdnOuY5w==
advanced-cropper@~0.10.2:
version "0.10.2"
resolved "https://registry.yarnpkg.com/advanced-cropper/-/advanced-cropper-0.10.2.tgz#b6459601080a9702886e9a3e96f337eb187195f7"
integrity sha512-l81sdn73ZOG3R3FD2OHJq48ytTbWbvI7+3ZPDVZxo3h2S59cVyknNBBPg44UXzM8LA4OpJcOjzZFOrb4iT0DhA==
dependencies:
tslib "^2.4.0"

Expand Down

0 comments on commit a92b568

Please sign in to comment.