In my file Style.ts, I have a class called Style:
export class Style
{
...
}
The Style class consists of properties, methods, and a constructor, along with import statements for other class dependencies. It is being used by other classes through the following es6 import statement:
import { Style } from "../Theming/Style";
When I set this file as an entry point for webpack, it results in the following output at the end of the bundle:
/***/ 0:
/*!***************************************************************!*\
/* ./src/Forms/Theming/Style ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! ./src/Forms/Theming/Style
*/"./src/Forms/Theming/Style.ts");
Surprisingly, the Style class does not appear in the bundle. If I exclude this file as an entry point, it gets completely ignored, even if it's being utilized by another module that is included as an entry point. This issue is occurring with multiple files, and I'm struggling to understand why.
Here is my webpack config file:
module.exports = {
watch: false,
mode: "development",
devtool: false,
entry:
{
main: common.entryPoints
},
output:
{
path: __dirname + "/../dist",
filename: "forms-library.js",
library: "FormsLibrary",
libraryTarget: "umd"
},
module:
{
rules:
[
{ test: /\.ts$/, use: "ts-loader", exclude: "/node_modules/" }
]
},
resolve:
{
extensions: [ ".ts" ],
modules: [ "./src" ]
}
}
This is my typescript configuration:
{
"exclude": ["node_modules","dist", "build"],
"compilerOptions":
{
"lib": [ "es2015", "dom" ],
"sourceMap": false,
"target": "es5",
"module": "es6"
}
}
Does anyone know why this issue is currently happening? Your insight would be greatly appreciated! Thank you!