Skip to content

Commit

Permalink
Update config
Browse files Browse the repository at this point in the history
  • Loading branch information
montalvomiguelo committed Sep 28, 2024
1 parent 4e417cc commit 5e114ce
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
4 changes: 0 additions & 4 deletions packages/vite-plugin-shopify/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default function shopifyConfig (options: Required<Options>): Plugin {
const port = config.server?.port ?? 5173
const https = config.server?.https
const origin = config.server?.origin ?? '__shopify_vite_placeholder__'
const socketProtocol = https === undefined ? 'ws' : 'wss'
const defaultAliases: Record<string, string> = {
'~': path.resolve(options.sourceCodeDir),
'@': path.resolve(options.sourceCodeDir)
Expand Down Expand Up @@ -67,9 +66,6 @@ export default function shopifyConfig (options: Required<Options>): Plugin {
hmr: config.server?.hmr === false
? false
: {
port,
protocol: socketProtocol,
...(typeof host === 'string' && { host }),
...(config.server?.hmr === true ? {} : config.server?.hmr)
}
}
Expand Down
4 changes: 1 addition & 3 deletions packages/vite-plugin-shopify/test/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ describe('vite-plugin-shopify:config', () => {
expect(config.server.https).toEqual(undefined)
expect(config.server.port).toEqual(5173)
expect(config.server.origin).toEqual('__shopify_vite_placeholder__')
expect(config.server.hmr.host).toEqual('localhost')
expect(config.server.hmr.port).toEqual(5173)
expect(config.server.hmr.protocol).toEqual('ws')
expect(config.server.hmr).toMatchObject({})
})

it('accepts a partial configuration', () => {
Expand Down

0 comments on commit 5e114ce

Please sign in to comment.