Skip to content

Instantly share code, notes, and snippets.

@cjus
Last active June 15, 2018 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjus/7fe2e871931e960be3fe47d2dd7c93dd to your computer and use it in GitHub Desktop.
Save cjus/7fe2e871931e960be3fe47d2dd7c93dd to your computer and use it in GitHub Desktop.
Preact Webpack Hook
export default (config, env, helpers) => {
config.target = 'electron-renderer';
if (env.production) {
config.output.publicPath = env.pkg.homepage;
let {plugin} = helpers.getPluginsByName(config, 'DefinePlugin')[0];
plugin.definitions['PUBLIC_PATH'] = env.pkg.homepage;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment