mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix: resolve chunksDirName based on outNames dirname (vercel)
This commit is contained in:
parent
1e34041e8d
commit
e16aee43ba
@ -1,5 +1,5 @@
|
||||
import Module from 'module'
|
||||
import { join, resolve } from 'path'
|
||||
import { dirname, join, resolve } from 'path'
|
||||
import { InputOptions, OutputOptions } from 'rollup'
|
||||
import { terser } from 'rollup-plugin-terser'
|
||||
import commonjs from '@rollup/plugin-commonjs'
|
||||
@ -88,12 +88,14 @@ export const getRollupConfig = (options: SLSOptions) => {
|
||||
external.push(...Module.builtinModules)
|
||||
}
|
||||
|
||||
const chunksDirName = join(dirname(options.outName), 'chunks')
|
||||
|
||||
const rollupConfig: RollupConfig = {
|
||||
input: resolvePath(options, options.entry),
|
||||
output: {
|
||||
dir: options.targetDir,
|
||||
entryFileNames: options.outName,
|
||||
chunkFileNames: 'chunks/_[name].js',
|
||||
chunkFileNames: join(chunksDirName, '_[name].js'),
|
||||
inlineDynamicImports: options.inlineChunks,
|
||||
format: 'cjs',
|
||||
exports: 'auto',
|
||||
@ -129,7 +131,7 @@ export const getRollupConfig = (options: SLSOptions) => {
|
||||
rollupConfig.plugins.push(dynamicRequire({
|
||||
dir: resolve(options.buildDir, 'dist/server'),
|
||||
inline: options.node === false || options.inlineChunks,
|
||||
outDir: join(options.targetDir, 'chunks'),
|
||||
outDir: join(options.targetDir, chunksDirName),
|
||||
prefix: './',
|
||||
globbyOptions: {
|
||||
ignore: [
|
||||
|
Loading…
Reference in New Issue
Block a user