Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot configure webpack to correctly resolve @ in path in MacOS X #15

Open
chancelee opened this issue Jul 11, 2019 · 0 comments
Open

Comments

@chancelee
Copy link

1)my config.js

`'use strict'
'use strict'
const path = require('path')
const utils = require('./utils')
const config = require('../config')
const vueLoaderConfig = require('./vue-loader.conf')
var PostCompilePlugin = require('webpack-post-compile-plugin')
var TransformModulesPlugin = require('webpack-transform-modules-plugin')

function resolve (dir) {
return path.join(__dirname, '..', dir)
}

const createLintingRule = () => ({
test: /.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
include: [resolve('src'), resolve('test')],
options: {
formatter: require('eslint-friendly-formatter'),
emitWarning: !config.dev.showEslintErrorsInOverlay
}
})

module.exports = {
context: path.resolve(__dirname, '../'),
plugins: [
// ...
new PostCompilePlugin(),
new TransformModulesPlugin()
],
entry: {
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
'jsencrypt$':'jsencrypt/bin/jsencrypt.min.js',
'$common': path.resolve('src/common')
}
},`

2)npm run dev
3) error
these dependencies were not found:

  • @/views/Meeting/MeetingRoomList in ./src/router/modules/meeting.js
  • @/views/Meeting/applyList in ./src/router/modules/meeting.js
  • @/views/Meeting/meetingAdd in ./src/router/modules/meeting.js
  • @/views/Meeting/meetingDetail in ./src/router/modules/meeting.js
  • @/views/Meeting/meetingEdit in ./src/router/modules/meeting.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant