English 中文(简体)
2. 选择“环礁” 错误:在建立国家预防机制一揽子计划时预期表达
原标题:Getting `RollupError: Expression expected` when building NPM package

之后,我完成了我的环境准备工作,以建立我的第一个国家预防机制一揽子方案,以便与ROLUP bundler I got 进行联系。 缩略语:

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}
            ^

我试图用“<>>>>><>>>>>>><>>>>/em>加以固定,但似乎由于在<代码>内使用“<<>><>><><>> /代码”的方括号而出现这一问题。 方法

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 }
        })
      ]
    }
  }
]

我想通过使用ROLUP bundler,建立我的国家复读机制一揽子计划,但我的一揽子计划使用 标签在push<>/code>内。 阵列方法。

问题回答

在我的案件中,我利用Vite和缺席,在javascript文档中使用了jsx的延伸。 我有这一错误,因为我正试图从卷宗中进口一个部件。 在我改变延长期限之后,错误消失。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.