I'm trying to generate a bundle for a stenciljs component. With stenciljs with the following stencil.config.js
export const config: Config = {
namespace: 'geographicaladdressjs',
outputTargets: [
{
type: 'dist',
esmLoaderPath: '../loader',
},
{
type: 'dist-custom-elements',
externalRuntime: false,
},
{
type: 'docs-readme',
},
{
type: 'www',
serviceWorker: null, // disable service workers
},
],
testing: {
browserHeadless: "new",
collectCoverage: true,
clearMocks: true,
resetMocks: true,
coverageDirectory: "./reports",
coverageReporters: ["html", "text", "lcov"],
reporters:['default', ["jest-html-reporters", {
"publicPath": "./reports",
"expand": true,
}]]
},
minifyJs: true,
minifyCss: true,
sourceMap: false
};
I have 5 files perfectly working

But I need one js bundle with all project, with webpack I've got one but useless.
const path = require('path');
module.exports = {
mode: 'production',
entry: './dist/geographicaladdressjs/index.esm.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
},
resolve: {
extensions: ['.js'],
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
};
How could I have only one file?
The webpack solution is this
webpack.config.js
with mycomponent.js I have all config all in one