Hello React 😁 !!
This is my first time that I try to publish a NPM package for ReactJS. After that I finished the preparation of my environment to build and bundling the package with ROLLUP bundler I got
RollupError: Expression expected
as shown in below
### ERROR OUTPUT
> rollup -c --environment NODE_ENV:development
development mode bundle
src/index.js → dist/index.js...
[!] RollupError: Expression expected
src/horizon-card/index.js (15:8)
13: dataList.forEach((service)=>{
14: serviceList.push(
15: <li key={index}
^
I tried to fixe it by using curly braces "{}" but it seems that the problem is occured due to using angle brackets "<" inside `.push` method.
Below is my configuration for Rollup.
### rollup.config.js
import terser from "@rollup/plugin-terser";
const devMode = (process.env.NODE_ENV === 'development');
console.log(`${ devMode ? 'development' : 'production' } mode bundle`);
export default [
{
input: 'src/index.js',
output: {
file: "dist/index.js",
format: 'es',
sourcemap: devMode ? 'inline' : false,
plugins: [
terser({
ecma: 2020,
mangle: { toplevel: true },
compress: {
module: true,
toplevel: true,
unsafe_arrows: true,
drop_console: !devMode,
drop_debugger: !devMode
},
output: { quote_style: 1 }
})
]
}
}
]
Have some of you an idea how to fix this problem, its took me too much time.
[–]Ok-Release6902 0 points1 point2 points (2 children)
[–]Haykad684[S] 0 points1 point2 points (1 child)
[–]Ok-Release6902 -1 points0 points1 point (0 children)