我添加了一个static
文件夹,里面有一个demos
文件夹。根据{{3}} Nuxt将自动提供这些文件。它在localhost中工作但不在生产中。为什么呢?
这是我的`nuxt.config.js``
module.exports = {
head: {
script: [
{ src: 'https://cdn.jsdelivr.net/npm/chart.js@2.7.1/dist/Chart.min.js' },
{ src: 'https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.7.5/beautify.js' }
],
link: [
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic' },
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/icon?family=Material+Icons' }
],
meta: [ { charset: 'utf-8' } ]
},
plugins: [
'babel-polyfill',
'~/plugins/filters'
],
build: {
extend(config) {
config.resolve.alias['vue'] = 'vue/dist/vue.common'
}
},
router: {
middleware: 'auth'
},
css: [
'@/styles/style.sass'
]
}