Skip to content

Commit

Permalink
Merge pull request #667 from nextcloud-libraries/fix/dev-build
Browse files Browse the repository at this point in the history
build: fix dev and watch build by specifying CSS chunk path
  • Loading branch information
ShGKme authored Nov 28, 2023
2 parents 042c2a9 + 19e0702 commit 39ecb04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"scripts": {
"dev": "vite build --mode development",
"watch": "vite build --mode development --watch",
"build": "vite build --mode production && mv dist/main.css dist/style.css",
"build": "vite build --mode production",
"l10n:extract": "node build/extract-l10n.mjs",
"lint": "eslint --ignore-pattern dist/**/* .",
"lint:fix": "eslint --fix --ignore-pattern dist/**/* ."
Expand Down
2 changes: 2 additions & 0 deletions vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export default createLibConfig({
index: resolve(__dirname, 'src/main.ts'),
}, {
libraryFormats: ['cjs', 'es'],
// Rename CSS chunk
assetFileNames: (chunkInfo) => chunkInfo.name.endsWith('.css') ? 'style.css' : undefined,
replace: {
__TRANSLATIONS__: `;${JSON.stringify(translations)}`,
},
Expand Down

0 comments on commit 39ecb04

Please sign in to comment.