Skip to content

Commit

Permalink
consitent ~/static and ~/assets aliases
Browse files Browse the repository at this point in the history
closes #1257 #1241
  • Loading branch information
Pooya Parsa committed Aug 4, 2017
1 parent 9198e0c commit 6bcfaf8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions examples/async-component-injection/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<nuxt-link to="/">NUXT BLOG</nuxt-link>
</div>
<p class="links">
<a href="https://twitter.com/nuxt_js" target="_blank"><img src="~assets/img/twitter.png"></a>
<a href="https://github.com/nuxt/nuxt.js/tree/dev/examples/async-component-injection" target="_blank"><img src="~assets/img/github.png"></a>
<a href="https://twitter.com/nuxt_js" target="_blank"><img src="~/assets/img/twitter.png"></a>
<a href="https://github.com/nuxt/nuxt.js/tree/dev/examples/async-component-injection" target="_blank"><img src="~/assets/img/github.png"></a>
</p>
<div class="main">
<nuxt/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h3 class="date">Jul 10, 2017</h3>
<h1>Deep dive into the Ocean</h1>
<div class="content">
<img src="~assets/img/swimmer.jpg">
<img src="~/assets/img/swimmer.jpg">
<h2>Subtitle #1</h2>
<p>Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar.</p>
<h2>Another subtitle</h2>
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-build/pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="container">
<p><img src="~assets/nuxt.png" /></p>
<p><img src="~/assets/nuxt.png" /></p>
<p>This image is included as data:image/png;base64...</p>
<p>In the source code, the files generated are based on the build.filenames data.</p>
<p>If you look at the <a href="/_nuxt/vendor.js">vendor.js</a>, lodash has been included (cmd/ctrl + F "lodash").</p>
Expand Down
2 changes: 1 addition & 1 deletion examples/typescript/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
/*
** Build configuration
*/
css: ['tachyons/css/tachyons.min.css', '~assets/css/main.css'],
css: ['tachyons/css/tachyons.min.css', '~/assets/css/main.css'],
build: {
vendor: ['axios', 'gsap', 'vuex-class', 'nuxt-class-component']
},
Expand Down
4 changes: 2 additions & 2 deletions examples/with-vuetify/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ module.exports = {
/*
** Load Vuetify into the app
*/
plugins: ['~plugins/vuetify'],
plugins: ['~/plugins/vuetify'],
/*
** Load Vuetify CSS globally
*/
css: ['~assets/app.styl']
css: ['~/assets/app.styl']
}
7 changes: 4 additions & 3 deletions lib/builder/webpack/base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ export default function webpackBaseConfig ({ isClient, isServer }) {
'~~': join(this.options.rootDir),
'@': join(this.options.srcDir),
'@@': join(this.options.rootDir),
'static': join(this.options.srcDir, 'static'),
'~static': join(this.options.srcDir, 'static'),

// Used by vue-loader so we can use in templates
// with <img src="~/assets/nuxt.png" />
'assets': join(this.options.srcDir, 'assets'),
'~assets': join(this.options.srcDir, 'assets')
'static': join(this.options.srcDir, 'static')
},
modules: [
this.options.modulesDir,
Expand Down

0 comments on commit 6bcfaf8

Please sign in to comment.