2018-03-16 19:11:24 +00:00
|
|
|
import path from 'path'
|
2018-03-27 22:28:17 +00:00
|
|
|
import fs from 'fs'
|
2018-03-31 16:22:14 +00:00
|
|
|
import env from 'std-env'
|
2018-03-16 17:23:15 +00:00
|
|
|
|
2018-03-27 22:28:17 +00:00
|
|
|
const nuxtDir = fs.existsSync(path.resolve(__dirname, '..', 'package.json'))
|
|
|
|
? path.resolve(__dirname, '..') // dist
|
|
|
|
: path.resolve(__dirname, '..', '..') // src
|
|
|
|
|
2018-03-16 17:23:15 +00:00
|
|
|
export default {
|
2018-03-20 22:11:30 +00:00
|
|
|
// Information about running environment
|
2018-03-31 16:22:14 +00:00
|
|
|
dev: Boolean(env.dev),
|
2018-03-21 06:20:14 +00:00
|
|
|
debug: undefined, // = dev
|
2018-03-20 22:11:30 +00:00
|
|
|
|
|
|
|
// Mode
|
|
|
|
mode: 'universal',
|
|
|
|
|
2018-08-12 14:26:30 +00:00
|
|
|
// Server options
|
|
|
|
server: {
|
2018-09-02 09:20:25 +00:00
|
|
|
https: false,
|
2018-08-12 14:26:30 +00:00
|
|
|
port: process.env.NUXT_PORT ||
|
|
|
|
process.env.PORT ||
|
|
|
|
process.env.npm_package_config_nuxt_port,
|
|
|
|
host: process.env.NUXT_HOST ||
|
|
|
|
process.env.HOST ||
|
|
|
|
process.env.npm_package_config_nuxt_host
|
|
|
|
},
|
|
|
|
|
2018-03-20 22:11:30 +00:00
|
|
|
// Dirs
|
2018-08-13 16:16:25 +00:00
|
|
|
srcDir: undefined,
|
2018-03-16 17:23:15 +00:00
|
|
|
buildDir: '.nuxt',
|
2018-03-27 22:28:17 +00:00
|
|
|
nuxtDir,
|
|
|
|
nuxtAppDir: path.resolve(nuxtDir, 'lib', 'app'),
|
2018-03-16 17:23:15 +00:00
|
|
|
modulesDir: ['node_modules'], // ~> relative to options.rootDir
|
2018-03-20 22:11:30 +00:00
|
|
|
|
|
|
|
// Ignore
|
2018-03-16 17:23:15 +00:00
|
|
|
ignorePrefix: '-',
|
|
|
|
ignore: [
|
2018-07-21 16:33:41 +00:00
|
|
|
'**/*.test.*',
|
|
|
|
'**/*.spec.*'
|
2018-03-16 17:23:15 +00:00
|
|
|
],
|
2018-03-20 22:11:30 +00:00
|
|
|
|
2018-03-16 17:23:15 +00:00
|
|
|
extensions: [],
|
2018-03-20 22:11:30 +00:00
|
|
|
|
2018-03-16 17:23:15 +00:00
|
|
|
build: {
|
2018-08-12 12:39:43 +00:00
|
|
|
quiet: Boolean(env.ci || env.test),
|
2018-03-16 17:23:15 +00:00
|
|
|
analyze: false,
|
|
|
|
profile: process.argv.includes('--profile'),
|
|
|
|
extractCSS: false,
|
|
|
|
cssSourceMap: undefined,
|
|
|
|
ssr: undefined,
|
2018-03-23 07:34:55 +00:00
|
|
|
parallel: false,
|
|
|
|
cache: false,
|
2018-03-16 17:23:15 +00:00
|
|
|
publicPath: '/_nuxt/',
|
|
|
|
filenames: {
|
2018-08-22 21:54:08 +00:00
|
|
|
// { isDev, isClient, isServer }
|
|
|
|
app: ({ isDev }) => isDev ? '[name].js' : '[chunkhash].js',
|
|
|
|
chunk: ({ isDev }) => isDev ? '[name].js' : '[chunkhash].js',
|
|
|
|
css: ({ isDev }) => isDev ? '[name].js' : '[contenthash].css',
|
|
|
|
img: ({ isDev }) => isDev ? '[path][name].[ext]' : 'img/[hash:7].[ext]',
|
|
|
|
font: ({ isDev }) => isDev ? '[path][name].[ext]' : 'fonts/[hash:7].[ext]',
|
|
|
|
video: ({ isDev }) => isDev ? '[path][name].[ext]' : 'videos/[hash:7].[ext]'
|
2018-03-16 17:23:15 +00:00
|
|
|
},
|
2018-09-10 08:27:01 +00:00
|
|
|
loaders: {
|
|
|
|
file: {},
|
|
|
|
fontUrl: { limit: 1000 },
|
|
|
|
imgUrl: { limit: 1000 },
|
|
|
|
pugPlain: {},
|
|
|
|
vue: {
|
|
|
|
transformAssetUrls: {
|
|
|
|
video: 'src',
|
|
|
|
source: 'src',
|
|
|
|
object: 'src',
|
|
|
|
embed: 'src'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
css: {},
|
|
|
|
cssModules: {
|
|
|
|
localIdentName: '[local]_[hash:base64:5]'
|
|
|
|
},
|
|
|
|
less: {},
|
|
|
|
sass: {
|
|
|
|
indentedSyntax: true
|
|
|
|
},
|
|
|
|
scss: {},
|
|
|
|
stylus: {},
|
|
|
|
vueStyle: {}
|
|
|
|
},
|
2018-03-16 17:23:15 +00:00
|
|
|
styleResources: {},
|
|
|
|
plugins: [],
|
2018-03-19 18:40:33 +00:00
|
|
|
optimization: {
|
2018-08-31 21:47:49 +00:00
|
|
|
runtimeChunk: 'single',
|
2018-03-19 18:40:33 +00:00
|
|
|
splitChunks: {
|
|
|
|
chunks: 'all',
|
2018-03-28 05:57:46 +00:00
|
|
|
automaticNameDelimiter: '.',
|
2018-03-28 06:43:07 +00:00
|
|
|
name: undefined,
|
2018-03-19 18:40:33 +00:00
|
|
|
cacheGroups: {}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
splitChunks: {
|
2018-03-21 10:03:57 +00:00
|
|
|
layouts: false,
|
2018-03-19 18:40:33 +00:00
|
|
|
pages: true,
|
2018-03-21 10:03:57 +00:00
|
|
|
commons: true
|
2018-03-19 18:40:33 +00:00
|
|
|
},
|
2018-03-16 17:23:15 +00:00
|
|
|
babel: {
|
2018-03-31 20:23:47 +00:00
|
|
|
babelrc: false,
|
2018-05-06 18:46:02 +00:00
|
|
|
cacheDirectory: undefined
|
2018-03-16 17:23:15 +00:00
|
|
|
},
|
2018-05-06 18:46:02 +00:00
|
|
|
transpile: [], // Name of NPM packages to be transpiled
|
2018-08-15 14:22:26 +00:00
|
|
|
postcss: {
|
|
|
|
preset: {
|
|
|
|
// https://cssdb.org/#staging-process
|
|
|
|
stage: 2
|
|
|
|
}
|
|
|
|
},
|
2018-03-16 17:23:15 +00:00
|
|
|
templates: [],
|
|
|
|
watch: [],
|
|
|
|
devMiddleware: {},
|
|
|
|
hotMiddleware: {},
|
|
|
|
stats: {
|
|
|
|
chunks: false,
|
|
|
|
children: false,
|
|
|
|
modules: false,
|
|
|
|
colors: true,
|
2018-03-23 08:33:04 +00:00
|
|
|
warnings: true,
|
|
|
|
errors: true,
|
2018-03-16 17:23:15 +00:00
|
|
|
excludeAssets: [
|
|
|
|
/.map$/,
|
|
|
|
/index\..+\.html$/,
|
|
|
|
/vue-ssr-client-manifest.json/
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
generate: {
|
|
|
|
dir: 'dist',
|
|
|
|
routes: [],
|
|
|
|
concurrency: 500,
|
|
|
|
interval: 0,
|
|
|
|
subFolders: true,
|
|
|
|
fallback: '200.html',
|
|
|
|
minify: {
|
|
|
|
collapseBooleanAttributes: true,
|
|
|
|
collapseWhitespace: false,
|
|
|
|
decodeEntities: true,
|
|
|
|
minifyCSS: true,
|
|
|
|
minifyJS: true,
|
|
|
|
processConditionalComments: true,
|
|
|
|
removeAttributeQuotes: false,
|
|
|
|
removeComments: false,
|
|
|
|
removeEmptyAttributes: true,
|
2018-08-15 13:00:54 +00:00
|
|
|
removeOptionalTags: false,
|
2018-03-16 17:23:15 +00:00
|
|
|
removeRedundantAttributes: true,
|
|
|
|
removeScriptTypeAttributes: false,
|
|
|
|
removeStyleLinkTypeAttributes: false,
|
|
|
|
removeTagWhitespace: false,
|
|
|
|
sortAttributes: true,
|
|
|
|
sortClassName: false,
|
|
|
|
trimCustomFragments: true,
|
|
|
|
useShortDoctype: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
env: {},
|
|
|
|
head: {
|
|
|
|
meta: [],
|
|
|
|
link: [],
|
|
|
|
style: [],
|
|
|
|
script: []
|
|
|
|
},
|
|
|
|
plugins: [],
|
|
|
|
css: [],
|
|
|
|
modules: [],
|
|
|
|
layouts: {},
|
|
|
|
serverMiddleware: [],
|
|
|
|
ErrorPage: null,
|
|
|
|
loading: {
|
|
|
|
color: 'black',
|
|
|
|
failedColor: 'red',
|
|
|
|
height: '2px',
|
|
|
|
duration: 5000,
|
|
|
|
rtl: false
|
|
|
|
},
|
2018-03-25 18:35:13 +00:00
|
|
|
loadingIndicator: 'default',
|
2018-03-16 17:23:15 +00:00
|
|
|
transition: {
|
|
|
|
name: 'page',
|
|
|
|
mode: 'out-in',
|
|
|
|
appear: false,
|
|
|
|
appearClass: 'appear',
|
|
|
|
appearActiveClass: 'appear-active',
|
|
|
|
appearToClass: 'appear-to'
|
|
|
|
},
|
|
|
|
layoutTransition: {
|
|
|
|
name: 'layout',
|
|
|
|
mode: 'out-in'
|
|
|
|
},
|
|
|
|
dir: {
|
|
|
|
assets: 'assets',
|
|
|
|
layouts: 'layouts',
|
|
|
|
middleware: 'middleware',
|
|
|
|
pages: 'pages',
|
|
|
|
static: 'static',
|
|
|
|
store: 'store'
|
|
|
|
},
|
2018-08-08 19:05:23 +00:00
|
|
|
vue: {
|
|
|
|
config: {
|
|
|
|
silent: undefined, // = !dev
|
|
|
|
performance: undefined // = dev
|
|
|
|
}
|
|
|
|
},
|
2018-03-16 17:23:15 +00:00
|
|
|
router: {
|
|
|
|
mode: 'history',
|
|
|
|
base: '/',
|
|
|
|
routes: [],
|
|
|
|
middleware: [],
|
|
|
|
linkActiveClass: 'nuxt-link-active',
|
|
|
|
linkExactActiveClass: 'nuxt-link-exact-active',
|
|
|
|
extendRoutes: null,
|
|
|
|
scrollBehavior: null,
|
|
|
|
parseQuery: false,
|
|
|
|
stringifyQuery: false,
|
|
|
|
fallback: false
|
|
|
|
},
|
|
|
|
render: {
|
2018-03-20 08:25:46 +00:00
|
|
|
bundleRenderer: {
|
|
|
|
shouldPrefetch: () => false
|
|
|
|
},
|
2018-05-02 09:47:46 +00:00
|
|
|
resourceHints: true,
|
2018-03-16 17:23:15 +00:00
|
|
|
ssr: undefined,
|
|
|
|
http2: {
|
|
|
|
push: false,
|
|
|
|
shouldPush: null
|
|
|
|
},
|
|
|
|
static: {
|
|
|
|
prefix: true
|
|
|
|
},
|
2018-09-08 20:18:14 +00:00
|
|
|
compressor: {
|
2018-03-16 17:23:15 +00:00
|
|
|
threshold: 0
|
|
|
|
},
|
|
|
|
etag: {
|
|
|
|
weak: false
|
|
|
|
},
|
2018-08-10 09:34:55 +00:00
|
|
|
csp: false,
|
|
|
|
dist: {
|
|
|
|
// Don't serve index.html template
|
|
|
|
index: false,
|
|
|
|
// 1 year in production
|
|
|
|
maxAge: '1y'
|
|
|
|
}
|
2018-03-16 17:23:15 +00:00
|
|
|
},
|
2018-08-08 18:51:57 +00:00
|
|
|
// User-defined changes
|
|
|
|
watch: [],
|
2018-03-16 17:23:15 +00:00
|
|
|
watchers: {
|
|
|
|
webpack: {},
|
2018-08-15 11:48:34 +00:00
|
|
|
chokidar: {
|
|
|
|
ignoreInitial: true
|
|
|
|
}
|
2018-03-16 17:23:15 +00:00
|
|
|
},
|
|
|
|
editor: undefined,
|
|
|
|
hooks: null,
|
|
|
|
messages: {
|
2018-03-25 18:35:13 +00:00
|
|
|
loading: 'Loading...',
|
2018-03-16 17:23:15 +00:00
|
|
|
error_404: 'This page could not be found',
|
|
|
|
server_error: 'Server error',
|
|
|
|
nuxtjs: 'Nuxt.js',
|
|
|
|
back_to_home: 'Back to the home page',
|
|
|
|
server_error_details:
|
|
|
|
'An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.',
|
|
|
|
client_error: 'Error',
|
|
|
|
client_error_details:
|
|
|
|
'An error occurred while rendering the page. Check developer tools console for details.'
|
|
|
|
}
|
|
|
|
}
|