Skip to content

Commit

Permalink
Merge pull request #2 from nextcloud/chore/rename
Browse files Browse the repository at this point in the history
chore: Rename package to `@nextcloud/vite-config`
  • Loading branch information
susnux authored Jul 26, 2023
2 parents 85f1476 + f6a8b67 commit d2f896e
Show file tree
Hide file tree
Showing 3 changed files with 6,833 additions and 6,836 deletions.
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ vite.config.js

And your `vite.config.js` should look like this:
```js
import { createAppConfig } from '@susnux/nextcloud-vite-config'
import { createAppConfig } from '@nextcloud/vite-config'

export default createAppConfig({
// entry points: {name: script}
Expand All @@ -26,7 +26,7 @@ export default createAppConfig({
You can also modify the configuration, for example if you want to set an include path for the scss preprocessor:

```js
import { createAppConfig } from '@susnux/nextcloud-vite-config'
import { createAppConfig } from '@nextcloud/vite-config'
import { mergeConfig } from 'vite'
import path from 'node:path'

Expand All @@ -53,24 +53,18 @@ export default createAppConfig({
```

### Use with a library
There is also a configuration for libraries, this configuration will handle the output directory correctly and allows to define external dependencies:
There is also a configuration for libraries, this configuration will handle the output directory correctly and automatically mark all `dependencies` as external:

```js
import { createLibConfig } from '@susnux/nextcloud-vite-config'
import { createLibConfig } from '@nextcloud/vite-config'

const translations = //...

export default createLibConfig({
index: 'src/index.js',
}, {
defines: {
replace: {
TRANSLATIONS: translations,
},
externalDependencies: [
// mark 'vue' as external
'vue',
// mark all paths starting with `@nextcloud/vue` as external
/^@nextcloud\/vue/
]
})
```
Loading

0 comments on commit d2f896e

Please sign in to comment.