-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compile Chrome extension scripts using Vite
With this change, `content-script`, `devtools` and `fetch-patch` are compiled using Vite. This will make it possible to import things into them, and have better linting.
- Loading branch information
1 parent
69a1ca4
commit fbc1c08
Showing
8 changed files
with
91 additions
and
9 deletions.
There are no files selected for viewing
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,10 @@ | ||
--- | ||
"@rsc-parser/chrome-extension": minor | ||
"@rsc-parser/embedded-example": minor | ||
"@rsc-parser/core": minor | ||
"@rsc-parser/embedded": minor | ||
"@rsc-parser/storybook": minor | ||
"@rsc-parser/website": minor | ||
--- | ||
|
||
Compile Chrome extension scripts using Vite |
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,3 +1,3 @@ | ||
<body> | ||
<script src="devtools.js"></script> | ||
<script src="assets/devtools.js"></script> | ||
</body> |
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 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
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
...es/chrome-extension/public/fetch-patch.js → packages/chrome-extension/src/fetch-patch.ts
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 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
41 changes: 41 additions & 0 deletions
41
packages/embedded/vite.config.ts.timestamp-1715330062214-d930edb122cc3.mjs
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,41 @@ | ||
// vite.config.ts | ||
import { resolve } from "path"; | ||
import { defineConfig } from "file:///Users/alvar/Code/alvarlagerlof/rsc-parser/node_modules/vite/dist/node/index.js"; | ||
import react from "file:///Users/alvar/Code/alvarlagerlof/rsc-parser/node_modules/@vitejs/plugin-react/dist/index.mjs"; | ||
import dts from "file:///Users/alvar/Code/alvarlagerlof/rsc-parser/node_modules/vite-plugin-dts/dist/index.mjs"; | ||
import preserveDirectives from "file:///Users/alvar/Code/alvarlagerlof/rsc-parser/node_modules/rollup-plugin-preserve-directives/dist/index.js"; | ||
var __vite_injected_original_dirname = "/Users/alvar/Code/alvarlagerlof/rsc-parser/packages/embedded"; | ||
var vite_config_default = defineConfig({ | ||
plugins: [react(), dts()], | ||
build: { | ||
outDir: "./dist/js", | ||
emptyOutDir: false, | ||
lib: { | ||
// Could also be a dictionary or array of multiple entry points | ||
entry: resolve(__vite_injected_original_dirname, "RscDevtoolsPanel.tsx"), | ||
name: "embedded", | ||
// the proper extensions will be added | ||
fileName: "embedded", | ||
formats: ["es"] | ||
}, | ||
rollupOptions: { | ||
// make sure to externalize deps that shouldn't be bundled | ||
// into your library | ||
external: ["react"], | ||
output: { | ||
// Provide global variables to use in the UMD build | ||
// for externalized deps | ||
globals: { | ||
react: "React" | ||
}, | ||
preserveModules: true | ||
}, | ||
plugins: [preserveDirectives()] | ||
}, | ||
minify: false | ||
} | ||
}); | ||
export { | ||
vite_config_default as default | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9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