Dynamic import converter
What is this
dynamic-import-converter ./demo/
convert from...
<template>
<div>
<hoge />
<piyo />
</div>
</template>
<script>
import Hoge from "@/components/Hoge.vue"
import Piyo from "@/components/Piyo.vue"
export default {
components: {
Hoge,
Piyo
}
}
</script>
to
<template>
<div>
<hoge />
<piyo />
</div>
</template>
<script>
export default {
components: {
Hoge: () => import("@/components/Hoge.vue"),
Piyo: () => import("@/components/Piyo.vue")
}
}
</script>
Requirement
- Node.js v12
Usage
Install
npm install -g dynamic-import-converter
or
yarn global add dynamic-import-converter
Execute
dyanmic-import-converter ./YOUR_DIRECTORY_PATH/
Debug
yarn watch
node dist/main.js