optimize webpack bundles

This commit is contained in:
Alex Turchyn
2023-06-24 18:31:12 +03:00
parent 2c0bed9823
commit 8bb6ff7ab3
10 changed files with 91 additions and 18 deletions
+5 -1
View File
@@ -24,7 +24,6 @@
</template>
<script>
import { DirectUpload } from '@rails/activestorage'
import { IconUpload } from '@tabler/icons-vue'
export default {
@@ -49,10 +48,15 @@ export default {
return 'el' + Math.random().toString(32).split('.')[1]
}
},
mounted () {
import('@rails/activestorage')
},
methods: {
async upload () {
this.isLoading = true
const { DirectUpload } = await import('@rails/activestorage')
const blobs = await Promise.all(
Array.from(this.$refs.input.files).map(async (file) => {
const upload = new DirectUpload(