https://github.com/d2-projects/vue-filename-injector
Inject the file path of .vue
https://github.com/d2-projects/vue-filename-injector
Last synced: about 1 year ago
JSON representation
Inject the file path of .vue
- Host: GitHub
- URL: https://github.com/d2-projects/vue-filename-injector
- Owner: d2-projects
- Created: 2019-07-28T11:23:14.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T08:11:25.000Z (over 3 years ago)
- Last Synced: 2025-04-04T20:53:40.071Z (about 1 year ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 7
- Watchers: 4
- Forks: 4
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vue Filename Injector
Inject the file path of the `.vue` on `this.$options.__source`.
## Install
``` sh
yarn add @d2-projects/vue-filename-injector -D
```
or
``` sh
npm install @d2-projects/vue-filename-injector -D
```
## Usage
Only used for vue-cli3, `vue.config.js`:
``` js
const VueFilenameInjector = require('@d2-projects/vue-filename-injector')
module.exports = {
chainWebpack: config => {
// ...
// in here, only with chainWebpack
VueFilenameInjector(config, {
propName: '__source' // default
})
}
}
```
## Relevant
https://github.com/neutrinojs/webpack-chain
https://vue-loader.vuejs.org/guide/custom-blocks.html