Skip to content

Commit 41305c1

Browse files
authored
chore(docs): add ecample on how to alias Vue with Vue CLI (#5935)
1 parent 997ac96 commit 41305c1

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

docs/markdown/intro/README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,25 @@ BootstrapVue and PortalVue require access to the global `Vue` reference (via
214214
</p>
215215
</div>
216216

217-
**Example: Vue alias in webpack.config.js**
217+
**Example: Vue alias for [Vue CLI](https://cli.vuejs.org/) in `vue.config.js`**
218+
219+
```js
220+
const path = require('path')
221+
222+
module.exports = {
223+
chainWebpack: config => {
224+
config.resolve.alias.set(
225+
'vue$',
226+
// If using the runtime only build
227+
path.resolve(__dirname, 'node_modules/vue/dist/vue.runtime.esm.js')
228+
// Or if using full build of Vue (runtime + compiler)
229+
// path.resolve(__dirname, 'node_modules/vue/dist/vue.esm.js')
230+
)
231+
}
232+
}
233+
```
234+
235+
**Example: Vue alias in `webpack.config.js`**
218236

219237
```js
220238
module.exports = {

0 commit comments

Comments
 (0)