mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-05 21:53:56 +00:00
0dff1b8fe9
* feat: support `server` option in `nuxt.config.js` to set PORT and HOST * lint * change the conifg priority to `argv > nuxt.config.js > env.NUXT_PORT > env.PORT > package.json > default` * check for `options.server`
91 lines
1.8 KiB
JavaScript
91 lines
1.8 KiB
JavaScript
import path from 'path'
|
|
|
|
export default {
|
|
srcDir: __dirname,
|
|
server: {
|
|
port: 8000,
|
|
host: '0.0.0.0'
|
|
},
|
|
router: {
|
|
base: '/test/',
|
|
middleware: 'noop',
|
|
extendRoutes(routes) {
|
|
return [
|
|
...routes,
|
|
{
|
|
name: 'about-bis',
|
|
path: '/about-bis',
|
|
component: '~/pages/about.vue'
|
|
},
|
|
{
|
|
path: '/redirect/about-bis',
|
|
redirect: '/about-bis'
|
|
}
|
|
]
|
|
}
|
|
},
|
|
modulesDir: [path.join(__dirname, '..', '..', '..', 'node_modules')],
|
|
transition: 'test',
|
|
layoutTransition: 'test',
|
|
loadingIndicator: 'circle',
|
|
extensions: 'ts',
|
|
plugins: [
|
|
'~/plugins/test',
|
|
{ src: '~/plugins/only-client.js', ssr: false }
|
|
],
|
|
loading: '~/components/loading',
|
|
env: {
|
|
bool: true,
|
|
num: 23,
|
|
string: 'Nuxt.js',
|
|
object: {
|
|
bool: false,
|
|
string: 'ok',
|
|
num2: 8.23,
|
|
obj: {
|
|
again: true
|
|
}
|
|
}
|
|
},
|
|
build: {
|
|
publicPath: '/orion/',
|
|
cssSourceMap: true,
|
|
parallel: true,
|
|
analyze: {
|
|
analyzerMode: 'disabled',
|
|
generateStatsFile: true,
|
|
logLevel: 'error'
|
|
},
|
|
styleResources: {
|
|
scss: '~/assets/pre-process.scss'
|
|
},
|
|
babel: {
|
|
presets({ isServer }) {
|
|
return null // Coverage: Return null, so defaults will be used.
|
|
}
|
|
},
|
|
transpile: 'vue-test',
|
|
extend(config, options) {
|
|
return Object.assign({}, config, {
|
|
devtool: 'nosources-source-map'
|
|
})
|
|
}
|
|
},
|
|
css: [{ src: '~/assets/app.css' }],
|
|
render: {
|
|
csp: true,
|
|
http2: {
|
|
push: true,
|
|
shouldPush: (file, type) => type === 'script'
|
|
},
|
|
bundleRenderer: {
|
|
shouldPreload: (file, type) => {
|
|
return ['script', 'style', 'font'].includes(type)
|
|
}
|
|
},
|
|
static: {
|
|
maxAge: '1y'
|
|
}
|
|
}
|
|
}
|