Skip to content

Commit b6536de

Browse files
committed
Add .vue extension support
1 parent c2c9a9b commit b6536de

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

app/templates/_App.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
</div>
2323
</template>
2424

25-
<script>
26-
import Hello from './components/Hello.vue';
25+
<script><% if (extraConfig.isUseVueRouter) { %>
26+
import Hello from './components/Hello';
2727
2828
export default {
2929
components: {
3030
Hello,
3131
},
32-
};
32+
};<% } %>
3333
</script>
3434

3535
<style lang="less">

app/templates/_main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Vue from 'vue';
2-
import app from './App.vue';<% if (extraConfig.isUseVueRouter) { %>
2+
import app from './App';<% if (extraConfig.isUseVueRouter) { %>
33
import VueRouter from 'vue-router';
44
import { configRouter } from './route';<% } %>
55
<% if (extraConfig.isUseVueRouter) { %>

app/templates/_route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const components = {};
2-
components.Hello = require('./components/Hello.vue');
2+
components.Hello = require('./components/Hello');
33

44
export function configRouter(router) {
55
router.map({

app/templates/_webpack.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ module.exports = {
77
publicPath: 'dist/',
88
filename: 'bundle.js'
99
},
10+
resolve: {
11+
extensions: ['', '.js', '.vue']
12+
},
1013
module: {
1114
loaders: [
1215
{

0 commit comments

Comments
 (0)