-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upgrade dependencies & zip plugin ui files
- Loading branch information
Showing
5 changed files
with
70 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,6 @@ build | |
node_modules | ||
src/main/resources/plugin-ui | ||
|
||
/*.mjs | ||
/*.mjs | ||
|
||
src/main/resources/*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,60 @@ | ||
import svelte from 'rollup-plugin-svelte'; | ||
import resolve from '@rollup/plugin-node-resolve'; | ||
import pkg from './package.json'; | ||
import del from 'rollup-plugin-delete'; | ||
|
||
const name = pkg.name | ||
.replace(/^(@\S+\/)?(svelte-)?(\S+)/, '$3') | ||
.replace(/^\w/, m => m.toUpperCase()) | ||
.replace(/-\w/g, m => m[1].toUpperCase()); | ||
|
||
export default [{ | ||
const baseConfig = { | ||
input: 'src/main.js', | ||
output: [ | ||
{file: process.env.DEV ? "server.mjs" : "src/main/resources/plugin-ui/server.mjs", 'format': 'es'}, | ||
// { file: pkg.main, 'format': 'umd', name } | ||
], | ||
output: { | ||
format: 'es', | ||
chunkFileNames: '[name]-[hash].js', // Chunk file naming | ||
}, | ||
plugins: [ | ||
svelte({ | ||
compilerOptions: { | ||
generate: "ssr", | ||
hydratable: true | ||
}, | ||
emitCss: false | ||
del({ | ||
targets: process.env.DEV ? 'dist/*' : 'src/main/resources/plugin-ui/*', // Targets to clean | ||
runOnce: true // Run only once | ||
}), | ||
resolve() | ||
], | ||
watch: { | ||
include: "src/**" | ||
} | ||
}, { | ||
input: 'src/main.js', | ||
output: [ | ||
{file: process.env.DEV ? "client.mjs" : "src/main/resources/plugin-ui/client.mjs", 'format': 'es', name}, | ||
// { file: pkg.main, 'format': 'umd', name } | ||
resolve(), | ||
], | ||
plugins: [ | ||
svelte({ | ||
compilerOptions: { | ||
generate: "dom", | ||
hydratable: true | ||
}, | ||
emitCss: false | ||
}), | ||
resolve() | ||
], | ||
watch: { | ||
include: "src/**" | ||
preserveEntrySignatures: 'strict' | ||
}; | ||
|
||
export default [ | ||
// Server configuration | ||
{ | ||
...baseConfig, | ||
output: { | ||
...baseConfig.output, | ||
dir: process.env.DEV ? "dist/server" : "src/main/resources/plugin-ui/server", // Server directory | ||
entryFileNames: 'server.mjs' // Server entry file | ||
}, | ||
plugins: [ | ||
...baseConfig.plugins, | ||
svelte({ | ||
compilerOptions: { | ||
generate: "ssr", | ||
hydratable: true | ||
}, | ||
emitCss: false | ||
}) | ||
] | ||
}, | ||
// Client configuration | ||
{ | ||
...baseConfig, | ||
output: { | ||
...baseConfig.output, | ||
dir: process.env.DEV ? "dist/client" : "src/main/resources/plugin-ui/client", // Client directory | ||
entryFileNames: 'client.mjs' // Client entry file | ||
}, | ||
plugins: [ | ||
...baseConfig.plugins, | ||
svelte({ | ||
compilerOptions: { | ||
generate: "dom", | ||
hydratable: true | ||
}, | ||
emitCss: false | ||
}) | ||
] | ||
} | ||
}]; | ||
]; |