Skip to content

Commit

Permalink
revery config
Browse files Browse the repository at this point in the history
  • Loading branch information
tvler committed Mar 11, 2023
1 parent 9cb9faa commit 33e6ace
Showing 1 changed file with 54 additions and 57 deletions.
111 changes: 54 additions & 57 deletions extension/vite.config.shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ export function getConfig(
}

const input = [
// webextensionPolyfillPathName,
webextensionPolyfillPathName,
path.resolve(dirname, "src/popup.html"),
// path.resolve(dirname, "src/content-script.ts"),
// targets({
// chrome: path.resolve(dirname, "src/background.ts"),
// firefox: path.resolve(dirname, "src/background-page.html"),
// safari: path.resolve(dirname, "src/background-page.html"),
// }),
path.resolve(dirname, "src/content-script.ts"),
targets({
chrome: path.resolve(dirname, "src/background.ts"),
firefox: path.resolve(dirname, "src/background-page.html"),
safari: path.resolve(dirname, "src/background-page.html"),
}),
];

const extensionName = `StreetPass for Mastodon${
Expand Down Expand Up @@ -130,53 +130,54 @@ export function getConfig(
});
},
},
// targets<PluginOption>({
// chrome: null,
// firefox: null,
// safari: {
// name: "build-safari-app",
// writeBundle(options) {
// assert(options.dir);
targets<PluginOption>({
chrome: null,
firefox: null,
safari: {
name: "build-safari-app",
writeBundle(options) {
/*
assert(options.dir);
// childProcess.spawnSync(
// `xcrun /Applications/Xcode.app/Contents/Developer/usr/bin/safari-web-extension-converter`,
// [
// "--swift",
// "--macos-only",
// "--no-open",
// "--project-location",
// options.dir,
// options.dir,
// ],
// {
// shell: true,
// stdio: "inherit",
// }
// );
childProcess.spawnSync(
`xcrun /Applications/Xcode.app/Contents/Developer/usr/bin/safari-web-extension-converter`,
[
"--swift",
"--macos-only",
"--no-open",
"--project-location",
options.dir,
options.dir,
],
{
shell: true,
stdio: "inherit",
}
);
// childProcess.spawnSync(
// "xcodebuild",
// [
// "-project",
// `"${path.resolve(
// options.dir,
// `${extensionName}`,
// `${extensionName}.xcodeproj`
// )}"`,
// "-allowProvisioningUpdates",
// "DEVELOPMENT_TEAM=WLTVAXDPZT",
// "-quiet",
// ],
// {
// shell: true,
// stdio: "inherit",
// }
// );
// },
// },
// }),
childProcess.spawnSync(
"xcodebuild",
[
"-project",
`"${path.resolve(
options.dir,
`${extensionName}`,
`${extensionName}.xcodeproj`
)}"`,
"-allowProvisioningUpdates",
"DEVELOPMENT_TEAM=WLTVAXDPZT",
"-quiet",
],
{
shell: true,
stdio: "inherit",
}
);
*/
},
},
}),
],

build: {
outDir: targets({
firefox: path.resolve(dirname, "dist-firefox"),
Expand All @@ -193,17 +194,13 @@ export function getConfig(
commonjsOptions: {
include: [],
},

rollupOptions: {
strictDeprecations: true,
// preserveEntrySignatures: "strict",
preserveEntrySignatures: "strict",
input: input,
output: {
format: "es",
// minifyInternalExports: false,
inlineDynamicImports: true,
minifyInternalExports: false,
validate: true,

entryFileNames: `[name].js`,
assetFileNames: `[name].[ext]`,
chunkFileNames: `[name].js`,
Expand Down

0 comments on commit 33e6ace

Please sign in to comment.