no effect - how to check if even loaded?
See original GitHub issueI probably have something wrong with my configuration.
ts-jest
makes use of the same underlying tsconfig-paths
library right? it doesn’t have any problems running tests.
The error I get is
ERROR in ./src/app/root/application.tsx
Module not found: Error: Can't resolve '_modules/ui/tgr/page' in '/home/falieson/Code/Publications/tgrstack/skeletons/skeleton-tgr-app-express/src/app/root'
@ ./src/app/root/application.tsx 7:13-44
@ ./src/app/index.tsx
My project is structured like this
/webpack/webpack.js
/tsconfig.js
/src/
TSconfig.json is like this
"baseUrl": ".", /* Base directory to resolve non-absolute module names. */
"paths": { /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
"*": ["node_modules/*", "src/*",],
// list of submodules matching tslint
"!server/*": ["src/server/*"],
"!app/*": ["src/app/*"],
// implicitely app modules
"_modules/*": ["src/app/modules/*"],
},
Webpack config is like this
const rootPath = path.resolve(__dirname, '..')
const srcPath = path.resolve(rootPath, 'src')
const paths = {
_: rootPath,
src: { _: srcPath },
}
const typescript = (() => {
const configFile = path.resolve(paths._, 'tsconfig.json')
const tsOptions = {
context: paths._,
configFile,
transpileOnly: true,
}
const loader = {
test: /\.tsx?$/,
include: paths.src._,
use: [
{
loader: 'babel-loader',
options: {
babelrc: true,
}
},
{
loader: 'ts-loader',
options: tsOptions
}
]
}
const tsPaths = new TsconfigPathsPlugin({
logLevel: 'info',
configFile,
})
return {
loader,
paths: tsPaths,
}
})()
module.exports = {
node: {
__dirname: false,
__filename: false,
},
resolve: {
extensions: ['.csv', '.ts', '.tsx', '.js', '.json', '.jsx'],
modules: ['src', 'node_modules'],
},
module: {
rules: [
typescript.loader,
// graphql,
files,
],
},
plugins: [
new Dotenv(dotEnvOpts),
typescript.paths
],
}
Thanks for your consideration
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:5
Top Results From Across the Web
React Hooks: useEffect() is called twice even if an empty array ...
Put the console.log inside the useEffect. Probably you have other side effects that cause the component to rerender but the useEffect itself ...
Read more >Browser-level image lazy loading for the web - web.dev
This post covers the loading attribute and how it can be used to control the loading of images.
Read more >.load() | jQuery API Documentation
This method is a shortcut for .on( "load", handler ) . The load event is sent to an element when it and all...
Read more >Lazy loading - Web performance | MDN
You can determine if a given image has finished loading by examining the value of its Boolean complete property. Polyfill Include this polyfill ......
Read more >Bypass, remove, or rescan Audio Units plug-ins in Logic Pro ...
If you can't find a recently installed plug-in, restart your Mac, confirm the ... If the plug-in is still not available, check with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same issue here.
Project structure:
tsconfig.lib.json
From the README:
So, just move
typescript.paths
intoresolve.plugins
instead ofplugins
and you should be good.Might be a good idea to move that note further toward the top 🤔