Resolve non-js package importing

This commit is contained in:
Hana Shiro 2017-07-22 07:40:38 +08:00
parent 03aa65a888
commit 1401434594
3 changed files with 3 additions and 1 deletions

View File

@ -8,7 +8,7 @@
<script>
<% if (loading) { %>import NuxtLoading from '<%= (typeof loading === "string" ? loading : "./components/nuxt-loading.vue") %>'<% } %>
<% css.forEach(function (c) { %>
import '<%= wp(c.src || c) %>'
import '<%= relativeToBuild(resolvePath(c.src || c)) %>'
<% }) %>
let layouts = {

View File

@ -242,6 +242,7 @@ export default class Builder extends Tapable {
hash,
r,
wp,
resolvePath: this.nuxt.resolvePath.bind(this.nuxt),
relativeToBuild: this.relativeToBuild
}
})

View File

@ -16,6 +16,7 @@ export default class Nuxt extends Tapable {
this.options = Options(_options)
this.initialized = false
this.errorHandler = this.errorHandler.bind(this)