mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-17 11:15:14 +00:00
0337932115
Co-authored-by: Sébastien Chopin <seb@nuxtjs.com> Co-authored-by: Alexander Lichter <manniL@gmx.net>
36 lines
1.0 KiB
JavaScript
36 lines
1.0 KiB
JavaScript
|
|
import path from 'path'
|
|
import { defaultsDeep } from 'lodash'
|
|
import { version as coreVersion } from '../../packages/core/package.json'
|
|
import { loadNuxtConfig } from '../../packages/config/src/index'
|
|
|
|
export { Nuxt } from '../../packages/core/src/index'
|
|
export { Builder } from '../../packages/builder/src/index'
|
|
export { Generator } from '../../packages/generator/src/index'
|
|
export { BundleBuilder } from '../../packages/webpack/src/index'
|
|
export * from '../../packages/utils/src/index'
|
|
|
|
export const version = `v${coreVersion}`
|
|
|
|
export const loadFixture = async function (fixture, overrides) {
|
|
const rootDir = path.resolve(__dirname, '..', 'fixtures', fixture)
|
|
const config = await loadNuxtConfig({
|
|
rootDir,
|
|
configOverrides: {
|
|
dev: false,
|
|
test: true
|
|
}
|
|
})
|
|
|
|
// disable terser to speed-up fixture builds
|
|
if (config.build) {
|
|
if (!config.build.terser) {
|
|
config.build.terser = false
|
|
}
|
|
} else {
|
|
config.build = { terser: false }
|
|
}
|
|
|
|
return defaultsDeep({}, overrides, config)
|
|
}
|