我正在使用npm run build构建一个Vue项目。
当我将结果(根据这个问题的答案:How to deploy Vue app?的结果(index.html和dist文件夹)上载到ec2实例时,出现错误:
ERROR Failed to compile with 1 errors 4:58:08 PM
This relative module was not found:
* ./src/main.js in multi (webpack)-dev-server/client?
http://localhost:3000 webpack/hot/dev-server ./src/main.js
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import VueCurrencyFilter from 'vue-currency-filter'
import 'normalize.css'
import numeral from 'numeral'
import App from './App'
import router from './router'
import store from './store'
import Intro from '@/components/intro.vue'
import Result from '@/components/result.vue'
import conveneResult from '@/components/convene-result.vue'
import Toggle from '@/components/toggle.vue'
import currencyInput from '@/components/currency-input.vue'
import circleLegend from '@/components/circle-legend.vue'
import Compare from '@/components/compare.vue'
import Table from '@/components/table.vue'
import compareTable from '@/components/compare-table.vue'
// DETAILS
import HealthcareCosts from '@/components/details/healthcarecosts'
import Distraction from '@/components/details/distraction'
import WorkplaceExp from '@/components/details/workplaceexp'
import TurnoverCost from '@/components/details/turnovercost'
import Coffee from '@/components/details/coffee'
import DAC from '@/components/details/dac'
import Furniture from '@/components/details/furniture'
import Maintenance from '@/components/details/maintenance'
import OfficeSupplies from '@/components/details/officesupplies'
import Phone from '@/components/details/phone'
import Rent from '@/components/details/rent'
Vue.component('intro', Intro)
Vue.component('result', Result)
Vue.component('convene-result', conveneResult)
Vue.component('toggle', Toggle)
Vue.component('currency-input', currencyInput)
Vue.component('circle-legend', circleLegend)
Vue.component('compare', Compare)
Vue.component('table-self', Table)
Vue.component('compare-table', compareTable)
// DETAILS
Vue.component('healthcareCosts', HealthcareCosts)
Vue.component('distraction', Distraction)
Vue.component('workplaceExp', WorkplaceExp)
Vue.component('turnoverCost', TurnoverCost)
Vue.component('coffee', Coffee)
Vue.component('dac', DAC)
Vue.component('furniture', Furniture)
Vue.component('maintenance', Maintenance)
Vue.component('officesupplies', OfficeSupplies)
Vue.component('phone', Phone)
Vue.component('rent', Rent)
Vue.filter('formatNumber', function (value) {
return numeral(value).format('0,0.')
})
Vue.use(VueCurrencyFilter, {
symbol: '$',
thousandsSeparator: '.',
fractionCount: 2,
fractionSeparator: ',',
symbolPosition: 'front',
symbolSpacing: true
})
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
store,
components: { App },
template: '<App/>'
})
请告知我是否还有其他有用的信息。非常感谢您的帮助!