-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: fix playground config variants (#13725)
- Loading branch information
Showing
22 changed files
with
77 additions
and
85 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import sourcemap from './worker-sourcemap-config.js' | ||
export default sourcemap('hidden') |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import sourcemap from './worker-sourcemap-config.js' | ||
export default sourcemap('inline') |
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,50 +1,2 @@ | ||
import { defineConfig } from 'vite' | ||
import workerPluginTestPlugin from './worker-plugin-test-plugin' | ||
|
||
/** @param {boolean | 'inline' | 'hidden' | 'sourcemap'} sourcemap */ | ||
export default (sourcemap) => { | ||
sourcemap = | ||
/** @type {'inline' | 'hidden' | 'sourcemap'} */ ( | ||
process.env.WORKER_MODE | ||
) || sourcemap | ||
|
||
if (sourcemap === 'sourcemap') { | ||
sourcemap = true | ||
} | ||
|
||
const typeName = | ||
typeof sourcemap === 'boolean' ? 'sourcemap' : 'sourcemap-' + sourcemap | ||
|
||
return defineConfig({ | ||
base: `/iife-${typeName}/`, | ||
resolve: { | ||
alias: { | ||
'@': __dirname, | ||
}, | ||
}, | ||
worker: { | ||
format: 'iife', | ||
plugins: [workerPluginTestPlugin()], | ||
rollupOptions: { | ||
output: { | ||
assetFileNames: 'assets/[name]-worker_asset[hash].[ext]', | ||
chunkFileNames: 'assets/[name]-worker_chunk[hash].js', | ||
entryFileNames: 'assets/[name]-worker_entry[hash].js', | ||
}, | ||
}, | ||
}, | ||
build: { | ||
outDir: `dist/iife-${typeName}/`, | ||
sourcemap: sourcemap, | ||
rollupOptions: { | ||
output: { | ||
assetFileNames: 'assets/[name]-[hash].[ext]', | ||
chunkFileNames: 'assets/[name]-[hash].js', | ||
entryFileNames: 'assets/[name]-[hash].js', | ||
}, | ||
}, | ||
}, | ||
plugins: [workerPluginTestPlugin()], | ||
cacheDir: `node_modules/.vite-sourcemap-${typeName}`, | ||
}) | ||
} | ||
import sourcemap from './worker-sourcemap-config.js' | ||
export default sourcemap(true) |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { defineConfig } from 'vite' | ||
import workerPluginTestPlugin from './worker-plugin-test-plugin' | ||
|
||
/** @param {boolean | 'inline' | 'hidden' | 'sourcemap'} sourcemap */ | ||
export default (sourcemap) => { | ||
sourcemap = | ||
/** @type {'inline' | 'hidden' | 'sourcemap'} */ ( | ||
process.env.WORKER_MODE | ||
) || sourcemap | ||
|
||
if (sourcemap === 'sourcemap') { | ||
sourcemap = true | ||
} | ||
|
||
const typeName = | ||
typeof sourcemap === 'boolean' ? 'sourcemap' : 'sourcemap-' + sourcemap | ||
|
||
return defineConfig({ | ||
base: `/iife-${typeName}/`, | ||
resolve: { | ||
alias: { | ||
'@': __dirname, | ||
}, | ||
}, | ||
worker: { | ||
format: 'iife', | ||
plugins: [workerPluginTestPlugin()], | ||
rollupOptions: { | ||
output: { | ||
assetFileNames: 'assets/[name]-worker_asset[hash].[ext]', | ||
chunkFileNames: 'assets/[name]-worker_chunk[hash].js', | ||
entryFileNames: 'assets/[name]-worker_entry[hash].js', | ||
}, | ||
}, | ||
}, | ||
build: { | ||
outDir: `dist/iife-${typeName}/`, | ||
sourcemap: sourcemap, | ||
rollupOptions: { | ||
output: { | ||
assetFileNames: 'assets/[name]-[hash].[ext]', | ||
chunkFileNames: 'assets/[name]-[hash].js', | ||
entryFileNames: 'assets/[name]-[hash].js', | ||
}, | ||
}, | ||
}, | ||
plugins: [workerPluginTestPlugin()], | ||
cacheDir: `node_modules/.vite-sourcemap-${typeName}`, | ||
}) | ||
} |