小编fbf*_*boy的帖子

当 rollup.js 中有多个输入时,如何自定义输出文件名?

配置

\n
  {\n    input: ['src/index.js', 'src/module1/index.js', 'src/module2/index.js'],\n    output: {\n      dir: 'dist',\n      format: 'es'\n    }\n  }\n
Run Code Online (Sandbox Code Playgroud)\n

结构

\n
\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 dist\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 index.js\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 index2.js\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 index3.js\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 rollup.config.js\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 src\n    \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 index.js\n    \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 module1\n    \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 foo.js\n    \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 index.js\n    \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 module2\n        \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 bar.js\n        \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 index.js\n
Run Code Online (Sandbox Code Playgroud)\n

期望输出是这样的

\n
\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 dist\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 libname.js\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 module\n\xe2\x94\x82\xc2\xa0\xc2\xa0     \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 module1.js\n\xe2\x94\x82\xc2\xa0\xc2\xa0     \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 module2.js\n
Run Code Online (Sandbox Code Playgroud)\n

有什么选项或插件可以提供帮助吗?多谢!

\n

rollup rollupjs

0
推荐指数
1
解决办法
1154
查看次数

标签 统计

rollup ×1

rollupjs ×1