-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using buildAllPlatform
more than once in a single node process doesn't reload source files.
#404
Comments
Okazari
changed the title
Cannot use
Using Mar 18, 2020
buildAllPlatform
more than once in a single node process.buildAllPlatform
more than once in a single node process doesn't reload source files.
I add delete require.cache[resolvedPath] and still the same problem |
chazzmoney
pushed a commit
that referenced
this issue
Apr 17, 2020
Fixed in #405 Thank you! |
@muhammadsamir11 can you provide some more details, where are you adding that code and what problem are you having? |
dbanksdesign
pushed a commit
that referenced
this issue
Oct 5, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello there.
I'm currently building a design-token package for my lerna-monorepo that is able to build from a "noBrand" design to a multi brand design. To do so i have a personnal
design-tokens
package. It define the base file for mydesign-tokens
. Each of my brand package use mydesign-tokens
package as a CLI to build their own design-tokens. They can provide some new file for their brand to surchage some of the token values.Everything works fine. Until i want to add a
--watch
option to my cli.To do so i'm using
chokidar
like this :Problem is, executing
build()
twice doesn't reflect any changes to any of my watched files.I investigated a bit and it's due to the way file are loaded.
See this line :
style-dictionary/lib/utils/combineJSON.js
Line 45 in f02e505
I think it's due to some node optimisation. When running twice on a similiar
require()
it apear that it use cache.I'm able to solve this by replacing
require()
withJSON.parse(fs.readFileSync(, { encoding: "utf8" }))
But as you support JS files, i can't decently make a PR for this workaround.
Do you have any idea ? Thanks !
EDIT:
i found something else.
Adding
just before the
require
force to load the new version of the file.I will make a PR accordingly 😄
The text was updated successfully, but these errors were encountered: