Reputation: 1812
I have created a local node module and I have configured the webpack to consider this module (module is in src/component):
modules: ['node_modules', 'src/components'].concat(
process.env.NODE_PATH.split(path.delimiter).filter(Boolean)
)
While starting the project, babel does not transpile my react stateless function and I get an unexpeted token error in my jsx syntax. When I don't use a node module and I remove the local package.json file, everything works fine. How can I solve this problem?
Upvotes: 0
Views: 161
Reputation: 161477
See Babel's documentation for monorepo structures (repos with multiple packages).
The short answer is, convert your .babelrc
to a babel.config.js
file and put that in your project root. .babelrc
files are scoped to a specific package, so there is no way to use a .babelrc
to configure your src/components/foo
package.
Upvotes: 1