It's been a real struggle, but my baseUrl is functioning properly and my files are loading correctly. However, when I try to import Chalk from 'chalk
, I encounter this error.
i 「atl」: Using <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c9bdb0b9acbaaabba0b9bd89fae7ffe7fa">[email protected]</a> from typescript
i 「atl」: Using tsconfig.json from C:/Users/adria/Desktop/backup/Business/repositories/xTouch/tsconfig.json
i 「atl」: Checking started in a separate process...
i 「atl」: Time: 719ms
Hash: 13062a08d1faecf0a32b
Version: webpack 4.40.2
Time: 2119ms
Built at: 09/19/2019 12:50:05 AM
1 asset
Entrypoint main = xtouch.js
[0] ./src/CommandBase.ts 195 bytes {0} [built]
[1] ./src/xtouch.ts 670 bytes {0} [built]
[2] ./src/XTouchCommandManager.ts 648 bytes {0} [built]
[3] ./src/CommandHandler.ts 1.67 KiB {0} [built]
[4] ./src/CommandEcho.ts 512 bytes {0} [built]
[5] ./src/CommandHelp.ts 552 bytes {0} [built]
ERROR in ./src/xtouch.ts
Module not found: Error: Can't resolve 'chalk' in 'C:\Users\adria\Desktop\backup\Business\repositories\xTouch\src'
@ ./src/xtouch.ts 4:16-32
error Command failed with exit code 2.
I've attempted various solutions, but none seem to work.
// config/webpack.config.ts
const config: Configuration = {
entry: path.resolve(appSrc, 'xtouch.ts'),
mode: 'production',
target: 'node',
output: {
path: outDir,
filename: 'xtouch.js',
},
resolve: {
extensions: ['.ts', '.ts', '.json'],
modules: ['node_modules', appNodeModules].concat(appSrc || []),
},
module: {
rules: [
{
test: /.ts/,
loader: 'awesome-typescript-loader',
exclude: /node_modules/,
},
],
},
};
export default config;
File Structure (for context)
- config/
- paths.ts
- webpack.config.ts
- node_modules/
- src/
- xtouch.ts
- XTouchCommandManager.ts
- etc.
- tsconfig.json
- package.json
You can even find the public repository here. This situation is really causing me some stress.