Closed juliendargelos closed 8 months ago
Hi @juliendargelos thanks for the feature. I'd like to try this but I'm not sure how to use this addition in my existing extension. Can you help / documentate how we can use this?
Sorry for the delayed response!
I appreciate the PR, but I do think it's a little out of scope for what I'd want the plugin to be responsible for handling.
Neat implementation, though.
Hi @juliendargelos thanks for the feature. I'd like to try this but I'm not sure how to use this addition in my existing extension. Can you help / documentate how we can use this?
@ugurkellecioglu You can try it out using the safari
option:
webExtension({
safari: true
})
interface ViteWebExtensionOptions {
// ...
/**
* Enables and configures Safari build.
* Default: false
*/
safari?: boolean | SafariBuildOptions;
// ...
}
export interface SafariBuildOptions {
/**
* Safari extension build output
* Default: vite output dir with a `-safari` suffix
*/
dir?: string;
/**
* Name of the app
* Default: name provided in the manifest
*/
appName?: string;
/**
* Bundle identifier to build the app with
* Default: undefined
*/
bundleIdentifier?: string;
/**
* Build the app using objective-c instead of swift
* Default: false
*/
objc?: boolean;
}
Sorry for the delayed response!
I appreciate the PR, but I do think it's a little out of scope for what I'd want the plugin to be responsible for handling.
Neat implementation, though.
Hi @samrum , I really appreciate for this beautiful work you do but can you please explain why this PR is out of scope?
This whole project is about creating cross platform extensions right? Safari is one of them. I highly believe that (the PR) is a good feature to have. Is there a chance you to consider the decision you made?
Sorry for the delayed response!
I appreciate the PR, but I do think it's a little out of scope for what I'd want the plugin to be responsible for handling.
Neat implementation, though.
Hi @samrum , I really appreciate for this beautiful work you do but can you please explain why this PR is out of scope?
This whole project is about creating cross platform extensions right? Safari is one of them. I highly believe that (the PR) is a good feature to have. Is there a chance you to consider the decision you made?
I can understand why this feature would not fall within the scope of this plugin. It heavily relies on platform specific tools (MacOs XCode Command Line Tools), so for instance, this would not work on Windows or Linux distributions.
Also, my implementation is really a draft, it worked for me but, in some other cases, it may fail or behave strangely. So not ready for a release.
Nothing stops you from using it though ! Just clone the branch, build it and use the configuration I mentionned above :)
I'm not sure this falls within the scope of this plugin, but for my own use I implemented an additional build process to create Safari web extensions. It relies on the xcode command line tools to convert the existing output to a macOS app embedding the extension. It is generated during the
writeBundle
hook, and outputted aside the original dist folder.I believe my addition isn't that clean neither bulletproof right now, but it could be a starting point if you want to provide this feature.