Skip to content

Commit 8a5cf72

Browse files
author
Pooya Parsa
committed
fix: relative imports
1 parent 9209da9 commit 8a5cf72

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

lib/module.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { resolve, relative } = require('path')
1+
const { resolve } = require('path')
22
const { defaultsDeep, omit, startCase } = require('lodash')
33
const f7BuildConfig = require('./f7-config')
44

@@ -63,17 +63,11 @@ module.exports = function nuxt7 (_options) {
6363

6464
// Icons
6565
if (options.f7Icons) {
66-
options.f7IconsSrc = relative(
67-
this.options.buildDir,
68-
resolvePath('fonts/framework7-icons.css')
69-
)
66+
options.f7IconsSrc = resolvePath('fonts/framework7-icons.css')
7067
}
7168

7269
if (options.mdIcons) {
73-
options.mdIconsSrc = relative(
74-
this.options.buildDir,
75-
resolvePath('fonts/material-icons.css')
76-
)
70+
options.mdIconsSrc = resolvePath('fonts/material-icons.css')
7771
}
7872

7973
// Enable nativeUI for a better Native experience

lib/templates/framework7/f7.plugin.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import Framework7VueComponents from './f7.components'
66

77
// Framework7 Styles
88
<% if (options.css) { %>import './f7.styles.less'<% } %>
9-
<% if (options.f7IconsSrc) { %>import '../<%= relativeToBuild(resolvePath(options.f7IconsSrc)) %>'<% } %>
10-
<% if (options.mdIconsSrc) { %>import '../<%= relativeToBuild(resolvePath(options.mdIconsSrc)) %>'<% } %>
9+
<% if (options.f7IconsSrc) { %>import '<%= options.f7IconsSrc %>'<% } %>
10+
<% if (options.mdIconsSrc) { %>import '<%= options.mdIconsSrc %>'<% } %>
1111

1212
// Register F7 Vue Components
1313
Vue.use(Framework7VueComponents)

lib/templates/framework7/f7.router.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const _routes = recursiveRoutes(router.routes, '\t\t', _components)
2929
%>
3030

3131
<%= uniqBy(_components, '_name').map(route =>
32-
`import ${route._name} from '../${relativeToBuild(route.component)}'`
32+
`import ${route._name} from '${route.component}'`
3333
).join('\n')
3434
%>
3535

0 commit comments

Comments
 (0)