This is what I did to achieve this:
function requireAll(r) { r.keys().forEach(r); }
requireAll(require.context('./modules/', true, /\.js$/));
More Related Contents:
- Can I use webpack to generate CSS and JS separately?
- Conditional build based on environment using Webpack
- Why is my webpack bundle.js and vendor.bundle.js so incredibly big?
- What should I do to use this webpacked JS library? [closed]
- Passing environment-dependent variables in webpack
- babel-loader jsx SyntaxError: Unexpected token [duplicate]
- How to copy static files to build directory with Webpack?
- Calling webpacked code from outside (HTML script tag)
- Resolving require paths with webpack
- ES6 exporting/importing in index file
- How do I generate sourcemaps when using babel and webpack?
- Have Grunt generate index.html for different setups
- Using require(‘…’) with a variable vs. using a string in webpack
- How to bundle vendor scripts separately and require them as needed with Webpack?
- Error: Missing class properties transform
- Importing CSS files in Isomorphic React Components
- Webpack Express Cannot Resolve Module ‘fs’, Request Dependency is Expression
- Babel 7 – ReferenceError: regeneratorRuntime is not defined
- What are differences between SystemJS and Webpack?
- Webpack-dev-server compiles files but does not refresh or make compiled javascript available to browser
- Webpack: Bundle.js – Uncaught ReferenceError: process is not defined
- Webpack 5 – Uncaught ReferenceError: process is not defined
- Example of how to load static CSS files from node_modules using webpack?
- How to disable ESLint in vue-cli?
- Run command after webpack build
- How can I use webpack with express?
- how can I use top level “await” in typescript next.js
- How can I fix the “BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default" error?
- What does this javascript syntax mean ? (0, _parseKey2.default)(something) [duplicate]
- How to dynamically import SVG and render it inline