mirror of
https://github.com/vitejs/vite.git
synced 2024-11-22 07:09:05 +00:00
13 lines
292 B
JavaScript
13 lines
292 B
JavaScript
export default () => ({
|
|
name: 'plugin-for-worker',
|
|
transform(code, id) {
|
|
if (id.includes('worker/modules/test-plugin.js')) {
|
|
return {
|
|
// keep length for sourcemap
|
|
code: code.replace('plugin fail. ', 'plugin success!'),
|
|
map: null,
|
|
}
|
|
}
|
|
},
|
|
})
|