好的IDE + 好的代碼提示 = 高效率的開發
webstorm
設置@
和~
別名,有助於代碼查看和跳轉.javascript
在項目下建立一個webpack.config.js
,內容以下:vue
const path = require('path') module.exports = { resolve: { extensions: ['.js', '.json', '.vue', '.ts'], root: path.resolve(__dirname), alias: { '@': path.resolve(__dirname), '~': path.resolve(__dirname), }, }, }
代碼來源:https://github.com/nuxt/nuxt.js/issues/1881#issuecomment-338157397java
設置 IDEwebpack
webstorm -> file -> settings -> language & frameworks -> javascript -> webpack
指定一下 webpack.config.js 的文件路徑git