0👍
My suggestion is simpler and doesn’t require the additional overhead of regex:
const key = '/home/folder/something/mutations.js'
const filename = key.substring(key.lastIndexOf('/') + 1, key.lastIndexOf('.'))
console.log(filename)
- [Vuejs]-Adding a Vue.js v-bind:style attribute to an element that is dynamically created after page load
- [Vuejs]-Can I have a Vue app that has some static server rendered routes and some dynamic routes
Source:stackexchange.com