javascript - How to configure webpack to only bundle files within a directory? -


i've folder structure project looks this:

myproject |-- some-folder |   `-- src |       `-- index.tsx |-- src |   |-- components |   |   `-- files.tsx |   `-- index.tsx `-- webpack.config.js 

when run webpack, tries bundle index.tsx file in both src , some-folder.

this throw error because index.tsx file in some-folder has dependencies webpack cannot resolve since not meant bundled together.

this how i've configured webpack's entry point:

var config = {     context: __dirname + '/src',     entry: {        app: './index.tsx'     } } 

how can configure webpack files within src folder , not else unless define different full path in entry point?

seeing pretty old, might solved already, adding "exclude" statement make sure "/some-folder" omitted?


Comments