Comparing version 0.1.2 to 0.1.3
{ | ||
"name": "edgekit", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
@@ -45,3 +45,15 @@ import * as fs from 'node:fs'; | ||
const ssr = !!build?.ssr; | ||
const assetsDir = build?.assetsDir || '_edk'; | ||
const output = { | ||
entryFileNames: ssr | ||
? `[name].js` | ||
: path.posix.join(assetsDir, `[name]-[hash].js`), | ||
chunkFileNames: ssr | ||
? `chunks/[name].js` | ||
: path.posix.join(assetsDir, `c/[name]-[hash].js`), // c for chunks | ||
// this is required to set to match client/server assets build | ||
assetFileNames: path.posix.join(assetsDir, `a/[name]-[hash].[ext]`), // a for assets | ||
}; | ||
if (ssr) { | ||
@@ -55,6 +67,7 @@ entry_server_filename = path | ||
build: { | ||
assetsDir: 'chunks', | ||
assetsDir, | ||
outDir: '.node', | ||
rollupOptions: { | ||
input: opts.entry_server, | ||
output, | ||
}, | ||
@@ -77,3 +90,2 @@ }, | ||
.replace(path.extname(opts.entry_client), ''); | ||
const assetsDir = build?.assetsDir || '_edk'; | ||
@@ -89,16 +101,3 @@ return { | ||
}, | ||
output: { | ||
entryFileNames: path.posix.join( | ||
assetsDir, | ||
`[name]-[hash].js`, | ||
), | ||
chunkFileNames: path.posix.join( | ||
assetsDir, | ||
`c/[name]-[hash].js`, // c for chunks | ||
), | ||
assetFileNames: path.posix.join( | ||
assetsDir, | ||
`a/[name]-[hash].[ext]`, // a for assets | ||
), | ||
}, | ||
output, | ||
onwarn(warning, warn) { | ||
@@ -105,0 +104,0 @@ if (!warning.message.includes('__edgekit_html__')) { |
37637
1270