We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I get multiple output through this options:
import { defineConfig } from '@rslib/core'; export default defineConfig({ source: { entry: { "component-1": "./src/component-1/index.js", "component-2": "./src/component-2/index.js", } }, lib: [ { format: 'umd', umdName: 'MyLibrary', }, ], output: { target: 'web', filename: { js: '[name]/index.[contenthash:8].js', } }, });
It will get dist/component-1/index.js 、dist/component-2/index.js . But they use a same umdName MyLibrary.
dist/component-1/index.js
dist/component-2/index.js
MyLibrary
I hope Rslib can support buding multiple output with different umdNames.
Like outputs dist/component-1/index.js with umdName component__1 and dist/component-2/index.js with umdName component__2
component__1
component__2
Thanks.
lib.umdName can support function to map the entry so that i can tell which output use what name:
lib.umdName
function
import { defineConfig } from '@rslib/core'; export default defineConfig({ source: { entry: { "component-1": "./src/component-1/index.js", "component-2": "./src/component-2/index.js", } }, lib: [ { format: 'umd', umdName({ entryName }) { const maps = { "component-1": "component__1", "component-2": "component__2", } return maps[entryName] } }, ], });
or
support array config so that i can decide the output. Like this Rollup options:
Rollup
import { defineConfig } from 'rollup' export default defineConfig([ { input: 'src/component-1/index.js', output: [ { name: 'component__1', file: 'dist/component-1/index.js', format: 'umd', }, ], }, { input: 'src/component-2/index.js', output: [ { name: 'component__2', file: 'dist/component-2/index.js', format: 'umd', }, ], }, ])
The text was updated successfully, but these errors were encountered:
You can write arrays in lib config.
lib
import { defineConfig } from '@rslib/core'; export default defineConfig({ lib: [ { format: 'umd', umdName: 'MyLibrary1', source: { entry: { 'component-1': './src/component-1/index.js', }, }, }, { format: 'umd', umdName: 'MyLibrary2', source: { entry: { 'component-2': './src/component-2/index.js', }, }, }, ], output: { target: 'web', filename: { js: '[name]/index.[contenthash:8].js', }, }, });
Sorry, something went wrong.
It's done. Thanks.
It was my fault, I didn't notice that the entry is also configurable.
No branches or pull requests
What problem does this feature solve?
I get multiple output through this options:
It will get
dist/component-1/index.js
、dist/component-2/index.js
. But they use a same umdNameMyLibrary
.I hope Rslib can support buding multiple output with different umdNames.
Like outputs
dist/component-1/index.js
with umdNamecomponent__1
anddist/component-2/index.js
with umdNamecomponent__2
Thanks.
What does the proposed API look like?
lib.umdName
can supportfunction
to map the entry so that i can tell which output use what name:or
support array config so that i can decide the output. Like this
Rollup
options:The text was updated successfully, but these errors were encountered: