mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25:12 +00:00
50 lines
1.2 KiB
JavaScript
50 lines
1.2 KiB
JavaScript
|
module.exports = {
|
||
|
/*
|
||
|
** Headers of the page
|
||
|
*/
|
||
|
head: {
|
||
|
title: 'web-worker',
|
||
|
meta: [
|
||
|
{ charset: 'utf-8' },
|
||
|
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
||
|
{ hid: 'description', name: 'description', content: 'Nuxt.js project' }
|
||
|
],
|
||
|
link: [
|
||
|
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
|
||
|
]
|
||
|
},
|
||
|
/*
|
||
|
** Customize the progress bar color
|
||
|
*/
|
||
|
loading: { color: '#3B8070' },
|
||
|
plugins: [
|
||
|
{ src: '~/plugins/inject-ww', ssr: false } // web workers are only available client-side, hence ssr: false
|
||
|
],
|
||
|
/*
|
||
|
** Build configuration
|
||
|
*/
|
||
|
build: {
|
||
|
/*
|
||
|
** Run ESLint on save
|
||
|
*/
|
||
|
extend (config, { isDev, isClient }) {
|
||
|
if (isDev && isClient) {
|
||
|
config.module.rules.push({
|
||
|
enforce: 'pre',
|
||
|
test: /\.(js|vue)$/,
|
||
|
loader: 'eslint-loader',
|
||
|
exclude: /(node_modules)/
|
||
|
})
|
||
|
}
|
||
|
|
||
|
if (isClient) { // web workers are only available client-side
|
||
|
config.module.rules.push({
|
||
|
test: /\.worker\.js$/, // this will pick up all .js files that ends with ".worker.js"
|
||
|
loader: 'worker-loader',
|
||
|
exclude: /(node_modules)/
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|