module.exports = { entry: ‘./src/main.js‘, output: { path: path.resolve(__dirname, ‘./dist‘), publicPath: ‘/dist/‘, filename: ‘build.js‘ }, module: { rules: [ ] }, resolve: {
extensions: [".js", ".json"] //自动解决某些扩展
alias: { ‘vue$‘: ‘vue/dist/vue.esm.js‘, ‘components$‘: path.resolve(__dirname, ‘src/components/‘) } } } import Header from ‘components/Header.js‘ 这样我们引用一个指定文件时就不用再向以前那样写很长的路径了
自动解决某些扩展。默认为:
extensions: [".js", ".json"]
导入时可以让用户离开扩展程序:
import Header from ‘components/Header‘
时间: 2024-10-30 01:32:01