Skip to content

Commit

Permalink
Try to load compiled transformer differently
Browse files Browse the repository at this point in the history
  • Loading branch information
MoOx committed Jan 22, 2020
1 parent 1899679 commit 73a1dd3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
10 changes: 9 additions & 1 deletion bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@ if (args.filter(arg => !acceptedOptions.includes(arg)).length > 0) {
throw new Error("only accepted options are: "+acceptedOptions);
}

require("./src/Transformer.bs.js").make(sourcePath, outputPath, args.includes("--with-reason"), args.includes("--remove-fill"));
let transformer;
try {
transformer = require("./lib/js/src/Transformer.bs.js")
}
catch(e) {
throw new Error("react-from-svg: impossible to get compiled Transformer module compiled from bs. Try reinstalling your dependencies or open an issue with as much as information as you can (bsconfig, etc) https://github.com/MoOx/react-from-svg/issues/new");
}

transformer.make(sourcePath, outputPath, args.includes("--with-reason"), args.includes("--remove-fill"));
2 changes: 1 addition & 1 deletion bsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"package-specs": {
"module": "commonjs",
"in-source": true
// "in-source": true
},
"suffix": ".bs.js",
"sources": [
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
"svg:--with-reason": "trash test/components && ./bin.js test test/components --with-reason && yarn svg:format",
"svg:--all": "trash test/components && ./bin.js test test/components --with-reason --remove-fill && yarn svg:format",
"svg:--all2": "trash test/components && ./bin.js test test/components --remove-fill --with-reason && yarn svg:format",
"test": "yarn re:build && yarn svg:--nothing && yarn svg:--remove-fill && yarn svg:--with-reason && yarn svg:--all && yarn svg:--all2",
"test": "yarn re:clean && yarn re:build && yarn svg:--nothing && yarn svg:--remove-fill && yarn svg:--with-reason && yarn svg:--all && yarn svg:--all2",
"release": "npmpub"
},
"dependencies": {
"bs-platform": "^5.0.1",
"bs-platform": "^7.0.0",
"glob": "^7.1.3",
"mkdirp": "^0.5.1",
"reason-future": "^2.4.0",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ brace-expansion@^1.1.7:
balanced-match "^1.0.0"
concat-map "0.0.1"

bs-platform@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-5.0.1.tgz#0e7a50a1b51896d3ff4e1df6e79d32530ba062f5"
integrity sha512-k3b0G9JIlavtooyQukQNCyhnE6p400vR4Nx3pdKwQpo4xlnOrUOeHV+9TBj/XAuSRRDOOgw2H57iGTCPpLxjMg==
bs-platform@^7.0.0:
version "7.0.1"
resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-7.0.1.tgz#1d7b0ef6088b998dceee5db74a7cd8f01c20a3bd"
integrity sha512-UjStdtHhbtC/l6vKJ1XRDqrPk7rFf5PLYHtRX3akDXEYVnTbN36z0g4DEr5mU8S0N945e33HYts9x+i7hKKpZQ==

camelcase-keys@^2.0.0:
version "2.1.0"
Expand Down

0 comments on commit 73a1dd3

Please sign in to comment.