Our project has been restructured into a mono repository using NPM Workspaces, with the following structure:
|-- apps
|-- native <-- Does not belong to Workspace
|-- web <-- Does not belong to Workspace
|-- common
|-- models <-- Workspace
|-- connectors <-- Workspace
|-- store <-- Workspace
|-- types <-- Workspace
|-- utils <-- Workspace
-- package-lock.json
-- package.json
The native
and web
apps utilize code from the common
folder, without sharing code between them.
root package.json
-----------------
{
"name": "@secret/client",
"version": "1.0.0",
"private": true,
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"workspaces": [
"./common/*"
]
}
Encountered Issue
During the compilation of TypeScript files, only the TypeScript files in the common
folder are failing to compile, throwing Parsing error: Unexpected token
errors. However, TypeScript files in native
and web
are compiling without errors.
https://i.sstatic.net/tbp5r.png
Webpack module.rules
... Displaying webpack module rules content ...
ESLintWebpackPlugin
... Displaying ESLintWebpackPlugin content ...
ForkTsCheckerWebpackPlugin
... Displaying ForkTsCheckerWebpackPlugin content ...
Example: common/connectors/package.json
... Displaying package.json content for connectors ...