I'm kinda of new to rollup, and been having several issues with it over the last couple of weeks.
I'm currently using rollup to build Lit components to production.
And for some unknown reason, when it generates a file which contains, what I believe is the reactive state for every component - query-assigned-elements-78bcb1b1.js.
Every component that has reactive state then imports this file.
I need to do not output this file, and keep the state in the actual files, since the components needs to be used alone, without any dependencies and imports.
rollup-config.mjs:
...
export default (args) => {
const isProd = args.prod ? true : false;
const isDev = args.dev ? true : false;
console.log(
`Building ${
isProd ? 'production' : isDev ? 'development' : 'local'
} build..`
);
const distProd = 'dist';
const distDev = 'dev/dist';
const distLocal = 'dev/components';
let envPath = isProd ? distProd : isDev ? distDev : distLocal;
let build = [
{
input: ['src/**/[!_]*.ts'],
output: {
dir: envPath,
},
plugins: [
resolve(),
multiInput.default({
relative: 'src/',
}),
commonjs(),
typescript({
compilerOptions: {
outDir: envPath,
sourceMap: false,
declaration: false,
declarationMap: false,
inlineSources: false,
},
}),
template(),
terser({
ecma: 2017,
module: true,
warnings: true,
}),
copy({
patterns: '**/assets/*.{svg,png,jpg,gif,webp}',
rootDir: './src',
}),
],
preserveEntrySignatures: 'strict',
},
];
return build;
};
Every component then has import{r as t,_ as e,e as o,n as i,s as r,$ as a}from"../query-assigned-elements-78bcb1b1.js";. Any suggestions would be greatly appreciated.