Packaging doesn't include docx type files.
See original GitHub issueI am using a docxtemplater on main.dev which is called with ipc. In here, I write data to different docx templates which lies in /app/main-helpers folder.
The sample code that I use for the templatePath can be find in below.
const templatePath = path.join( path.dirname(__filename), 'main-helpers', 'docx-templates', 'single-location-count-control-template.docx' );
Before packaging everything works due to webpack is working in /app folder and the ipc event can find the docx items. After packaging the ipc event cannot find the path, probably because it is not packaged.
Any idea on how to load this folder with webpack on packaging.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9
Top Results From Across the Web
C# DocX Create File - visual studio - Stack Overflow
I just tried installing the DocX NuGet package and there were no dependencies. I just tried your code and, with a change of...
Read more >Option --include-before-body does not work with docx writer ...
My understanding of reference.docx is that it can only modify style, and not add content. ... Setting the --include-before-body flag to a file...
Read more >Word App failing to open docx file on Android tablet
It allows me to open some files on direct download but throws this error message with others that are of the same file...
Read more >Working with Documents - python-docx - Read the Docs
python-docx allows you to create new documents as well as make changes to existing ones. Actually, it only lets you make changes to...
Read more >docx-templates - npm
TypeScript icon, indicating that this package has built-in type ... Then read this file in an ArrayBuffer, feed it to docx-templates, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Based on @dayfine 's comments how to solve this issue.
I made a deep analysis of our code that is using this boilerplate as its base. The problem is occurring because of the reasons that dayfine is indicated.
Inside the main package.json, we have a build configuration that shows the files as an Array. This array is implemented to the project as the bare minimum. Thanks to webpack, these things will be packaged in most of the projects. In our case, the problem was we were never importing the mentioned folder, so webpack cannot handle to carry them to either main.prod.js or dist/ folder.
With investigating the asar resources structure, I have understanded that the main.prod.js is still lying in the same level as in development environment app/.
So adding the folders that is never imported to any of the project files (only defined as absolute paths) is helped me solve this bug (along with 2 unpackaged folders).
As it can be seen that main.prod.js is directly listed in the files section, you should import all other folder and files based on main.dev.js’s folder level.
@musyilmaz Hey there, I’m having a similar issues. In the
appfolder I have defined ascriptsdirectory with couple of binary scripts inside. I’ve added this do thefilesso it currently looks like this:When I run
npm run packagethe files are still not included in the.asarpackage 😕 Do I have to import those files from the code (so they go through webpack)? Would really appreciate your help!