How to get webpack to bundle subfolders? #1542
Unanswered
rabrowne85
asked this question in
Q&A
Replies: 1 comment
-
So a little update on this. I've managed to get it to work, but I've had to rewrite some of my code. Originally I had the following in my fs
.readdirSync(path.join(__static, '../models'))
.filter(file => {
return 0 !== file.indexOf('.') && file !== basename && '.js' === file.slice(-3);
})
.forEach(file => {
const model = __non_webpack_require__(path.join(__static, '../models', file))(sequelize, Sequelize.DataTypes);
db[model.name] = model;
}); to iterate through the However, because I was using I couldn't get the normal Would be interested if anyone knows a way to do the folder read and import with webpack. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I'm struggling with building my application for windows as I don't think webpack is bundling the files correctly.
My folder structure looks like this:
Within my
background.js
file I'm doing something like this:As I understood things, this should cause webpack to bundle the file into the
app.js
file.When I run the serve, everything works fine, no issues whatsoever. However, when I run build, it compiles the .exe file, but if i try and run it I get an error message such as the follows:
I've tried using the
extraResources
option, moving the files topublic
folder and various other things.Fundamentally, I feel that
webpack
should be bundling them together, but it's not, but i can't see why not.I'm open to moving folders to different locations if needed, but really need to get this to work.
Any help would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions