Skip to content

Commit

Permalink
feat(vite): rewrite lib test to use custom filename
Browse files Browse the repository at this point in the history
  • Loading branch information
gobeli committed Jun 2, 2021
1 parent f04826a commit 244835d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions packages/playground/lib/index.dist.html
@@ -1,15 +1,14 @@
<!-- the production demo page, copied into dist/ -->

<div class="es"></div>
<div class="umd"></div>

<script type="module">
import myLib from './my-lib.es.js'
import myLib from './my-lib-custom-filename.es.js'

myLib('.es')
</script>

<script src="./my-lib.umd.js"></script>
<script src="./my-lib-custom-filename.umd.js"></script>
<script>
MyLib('.umd')
</script>
3 changes: 2 additions & 1 deletion packages/playground/lib/vite.config.js
Expand Up @@ -8,7 +8,8 @@ module.exports = {
build: {
lib: {
entry: path.resolve(__dirname, 'src/main.js'),
name: 'MyLib'
name: 'MyLib',
fileName: (format) => `my-lib-custom-filename.${format}.js`
}
},
plugins: [
Expand Down

0 comments on commit 244835d

Please sign in to comment.