webpack配置技巧--路径

resolve: {
extensions: ['', '.js', '.vue'],
fallback: [path.join(__dirname, '../node_modules')],
alias: {
'vue$': 'vue/dist/vue.common.js',
'src': path.resolve(__dirname, '../src'),
'assets': path.resolve(__dirname, '../src/assets'),
'components': path.resolve(__dirname, '../src/components')
}
},


'components': path.resolve(__dirname, '../src/components')为例:
路径可以直接写'components/.......'
不用再'./components/...'这样一级一级目录去找了
posted @ 2016-12-14 19:30  觉信  阅读(1016)  评论(0编辑  收藏  举报