I've been exploring the use of Typescript in my browser with a specific architecture: Typescript in browser architecture
However, I'm facing an issue with the import/export functionality when running this command:
tsc && babel build-ts -d lib && webpack --config webpack.config.js
ERROR in ./lib/index.js Module not found: Error: Can't resolve 'index' in 'C:\Users\aurel\Desktop\Platformer\lib'
ERROR in ./lib/index.js Module not found: Error: Can't resolve 'file' in 'C:\Users\aurel\Desktop\Platformer\lib'
index.html :
<script src="dist/bundle.js"></script>
index.ts
export const index = "test";
import { file } from 'file';
console.log(file)
file.ts
export const file = "test";
import { index } from 'index';
console.log(index)
webpack.config.js
const glob = require("glob");
module.exports = {
entry: {
js: glob.sync("./lib/**/*.js"),
},
output: {
filename: 'bundle.js',
path: __dirname + '/dist',
},
};
tsconfig.json
"target": "es6",
"module": "amd",
"outDir": "./build-ts",
Any ideas on how to solve this issue? I would appreciate any help, thank you in advance!