Skip to content
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.

Commit

Permalink
Update examples/custom-build-options #8
Browse files Browse the repository at this point in the history
  • Loading branch information
saltyshiomix committed Oct 12, 2019
1 parent 0b02d71 commit fb60855
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 82 deletions.
18 changes: 9 additions & 9 deletions examples/custom-build-options/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
<p align="center"><img src="https://i.imgur.com/Nt6SNJb.png"></p>
<p align="center"><img src="https://i.imgur.com/PTqXTbx.png"></p>

## Usage

```bash
# create an app
$ nuxtron init my-app --example custom-build-options

# install dependencies
$ cd my-app

# Install dependencies
$ yarn (or `npm install`)

# Run development mode
# development mode
$ yarn dev (or `npm run dev`)

# Build packages
# production build
$ yarn build (or `npm run build`)

# Build packages for all platform
# production build for all platform
$ yarn build:all (or `npm run build:all`)

# Build packages for windows 32 bit
# production build for windows 32 bit
$ yarn build:win (or `npm run build:win`)

# Build packages for macOS 64 bit
# production build for macOS 64 bit
$ yarn build:mac (or `npm run build:mac`)

# Build packages for Linux
# production build for Linux
$ yarn build:linux (or `npm run build:linux`)
```
12 changes: 12 additions & 0 deletions examples/custom-build-options/electron-builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
appId: com.example.nuxtron
productName: My Nuxtron App
copyright: Copyright © 2019 Shiono Yoshihide
directories:
output: dist
buildResources: resources
files:
- from: .
filter:
- package.json
- app
publish: null
43 changes: 13 additions & 30 deletions examples/custom-build-options/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,24 @@
"name": "custom-build-options",
"description": "My application description",
"version": "1.0.0",
"author": "Yoshihide Shiono <[email protected]>",
"author": "Shiono Yoshihide <[email protected]>",
"main": "app/background.js",
"build": {
"appId": "com.example.nuxtron",
"productName": "My Nuxtron App",
"copyright": "Copyright © 2018 Yoshihide Shiono",
"directories": {
"output": "dist",
"buildResources": "resources"
},
"publish": null
},
"scripts": {
"dev": "node build/nuxtron.js",
"build": "node build/nuxtron.js build",
"build:all": "node build/nuxtron.js build --all",
"build:win": "node build/nuxtron.js build --win --ia32",
"build:mac": "node build/nuxtron.js build --mac --x64",
"build:linux": "node build/nuxtron.js build --linux"
"dev": "nuxtron",
"build": "nuxtron build",
"build:all": "nuxtron build --all",
"build:win": "nuxtron build --win --ia32",
"build:mac": "nuxtron build --mac --x64",
"build:linux": "nuxtron build --linux"
},
"dependencies": {
"fs-jetpack": "^2.2.2",
"nuxt": "2.8.1"
"electron-serve": "^0.4.0",
"electron-store": "^5.0.0"
},
"devDependencies": {
"arg": "^4.1.0",
"chalk": "^2.4.2",
"electron": "5.0.3",
"electron-builder": "20.43.0",
"fast-glob": "^2.2.6",
"friendly-errors-webpack-plugin": "^1.7.0",
"fs-extra": "^8.0.1",
"node-npx": "^1.3.1",
"ora": "^3.4.0",
"webpack": "^4.33.0",
"webpack-merge": "^4.2.1"
"electron": "^6.0.12",
"electron-builder": "^21.2.0",
"nuxt": "^2.10.1",
"nuxtron": "^0.1.31"
}
}
7 changes: 3 additions & 4 deletions examples/custom-build-options/renderer/nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
export default {
head: {
title: 'Nuxtron (custom-build-options)',
},
build: {
extend: (config) => {
config.target = 'electron-renderer';
},
extractCSS: true,
},
plugins: [
'~/plugins/nuxtron',
],
}
25 changes: 20 additions & 5 deletions examples/custom-build-options/renderer/pages/about.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
<template>
<div class="container">
<img :src="resolve('static/nuxt-black.png')">
<img src="/nuxt-black.png">
<h2>Thank you for testing Nuxtron</h2>
<p><a :href="resolve('home')">Back home</a></p>
<p>Loaded from the {{ name }}</p>
<p>
<NuxtLink to="/">
Back home
</NuxtLink>
</p>
</div>
</template>

<script>
export default {
asyncData ({ req }) {
return {
name: process.static ? 'static' : (process.server ? 'server' : 'client'),
}
}
}
</script>

<style scoped>
.container {
position: absolute;
Expand All @@ -16,10 +31,10 @@
background: black;
color: white;
font-family: "Lucida Console", Monaco, monospace;
padding-top: 130px;
padding-top: 100px;
text-align: center;
}
a {
color: silver;
color: white;
}
</style>
</style>
15 changes: 0 additions & 15 deletions examples/custom-build-options/renderer/pages/home.vue

This file was deleted.

40 changes: 40 additions & 0 deletions examples/custom-build-options/renderer/pages/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<template>
<div class="container">
<img src="/nuxt.png">
<h2>Hello Nuxtron.</h2>
<p>Loaded from the {{ name }}</p>
<p>
<NuxtLink to="/about">
About
</NuxtLink>
</p>
</div>
</template>

<script>
export default {
asyncData ({ req }) {
return {
name: process.static ? 'static' : (process.server ? 'server' : 'client'),
}
}
}
</script>

<style scoped>
.container {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
background: white;
color: black;
font-family: "Lucida Console", Monaco, monospace;
padding-top: 100px;
text-align: center;
}
a {
color: black;
}
</style>
19 changes: 0 additions & 19 deletions examples/custom-build-options/renderer/plugins/nuxtron.js

This file was deleted.

0 comments on commit fb60855

Please sign in to comment.