GithubHelp home page GithubHelp logo

hhy5277 / electron-next Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leo/electron-next

0.0 1.0 0.0 96 KB

Build Electron apps using Next.js

Home Page: https://leo.im/2017/electron-next

License: MIT License

JavaScript 100.00%

electron-next's Introduction

electron-next

Build Status XO code style

This package lets you use Next.js for building the renderer of your Electron apps!

  • In production, it ensures that the file:// protocol (which Electron uses to load your static assets in the renderer process) works properly with your Next.js bundle (generated by next export)
  • While developing, it takes care of the whole flow required for building the renderer code

Usage

Firstly, install the package using any node package manager:

yarn add electron-next

Then load it:

const prepareRenderer = require('electron-next')

As the final step, call the package:

  • <path>: The path to the directory containing the renderer (relative to the app's root directory). If the paths for development and production aren't the same, this can be an object holding a development and a production key with their respective paths (string|object).
  • <port>: Used for running Next.js in development (number, optional, defaults to 8000).
await prepareRenderer(<path>, <port>)

Caught a Bug?

  1. Fork this repository to your own GitHub account and then clone it to your local device
  2. Link the package to the global package directory: npm link
  3. Within the electron app of your choice, link it to the dependencies: npm link electron-next. Instead of the default one from npm, it will now use your local clone of the package!

Author

electron-next's People

Contributors

albinekb avatar hellais avatar leo avatar manovotny avatar qix- avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.