diff --git a/.eslintignore b/.eslintignore index 48de14efb0..8e3846f0c8 100644 --- a/.eslintignore +++ b/.eslintignore @@ -8,7 +8,7 @@ coverage ## cofeescript examples/coffeescript/pages/index.vue - +examples/pug-stylus-coffee/ # Packages # vue-app diff --git a/examples/pug-stylus-coffee/README.md b/examples/pug-stylus-coffee/README.md new file mode 100644 index 0000000000..930f5e4d87 --- /dev/null +++ b/examples/pug-stylus-coffee/README.md @@ -0,0 +1,20 @@ +# Pug + Stylus + Coffee template for Nuxt.js + +> Ultimative complete pack for coding with pleasure and Nuxt.js + +## Build Setup + +``` bash +# install dependencies +$ npm install + +# serve with hot reload at localhost:3000 +$ npm run dev + +# build for production and launch server +$ npm run build +$ npm start + +# generate static project +$ npm run generate +``` diff --git a/examples/pug-stylus-coffee/components/Logo.vue b/examples/pug-stylus-coffee/components/Logo.vue new file mode 100644 index 0000000000..14799f76d3 --- /dev/null +++ b/examples/pug-stylus-coffee/components/Logo.vue @@ -0,0 +1,66 @@ + + + diff --git a/examples/pug-stylus-coffee/components/README.md b/examples/pug-stylus-coffee/components/README.md new file mode 100644 index 0000000000..a079f1060e --- /dev/null +++ b/examples/pug-stylus-coffee/components/README.md @@ -0,0 +1,7 @@ +# COMPONENTS + +**This directory is not required, you can delete it if you don't want to use it.** + +The components directory contains your Vue.js Components. + +_Nuxt.js doesn't supercharge these components._ diff --git a/examples/pug-stylus-coffee/layouts/README.md b/examples/pug-stylus-coffee/layouts/README.md new file mode 100644 index 0000000000..cad1ad5738 --- /dev/null +++ b/examples/pug-stylus-coffee/layouts/README.md @@ -0,0 +1,7 @@ +# LAYOUTS + +**This directory is not required, you can delete it if you don't want to use it.** + +This directory contains your Application Layouts. + +More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts). diff --git a/examples/pug-stylus-coffee/layouts/default.vue b/examples/pug-stylus-coffee/layouts/default.vue new file mode 100644 index 0000000000..540fff86da --- /dev/null +++ b/examples/pug-stylus-coffee/layouts/default.vue @@ -0,0 +1,46 @@ + + + diff --git a/examples/pug-stylus-coffee/middleware/README.md b/examples/pug-stylus-coffee/middleware/README.md new file mode 100644 index 0000000000..01595ded74 --- /dev/null +++ b/examples/pug-stylus-coffee/middleware/README.md @@ -0,0 +1,8 @@ +# MIDDLEWARE + +**This directory is not required, you can delete it if you don't want to use it.** + +This directory contains your application middleware. +Middleware let you define custom functions that can be run before rendering either a page or a group of pages. + +More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware). diff --git a/examples/pug-stylus-coffee/modules/coffeescript.js b/examples/pug-stylus-coffee/modules/coffeescript.js new file mode 100644 index 0000000000..b8ccfc05d5 --- /dev/null +++ b/examples/pug-stylus-coffee/modules/coffeescript.js @@ -0,0 +1,17 @@ +export default function () { + // Add .coffee extension for store, middleware and more + this.nuxt.options.extensions.push('coffee') + // Extend build + const coffeeLoader = { + test: /\.coffee$/, + loader: 'coffee-loader' + } + this.extendBuild((config) => { + // Add CoffeeScruot loader + config.module.rules.push(coffeeLoader) + // Add .coffee extension in webpack resolve + if (config.resolve.extensions.indexOf('.coffee') === -1) { + config.resolve.extensions.push('.coffee') + } + }) +} diff --git a/examples/pug-stylus-coffee/nuxt.config.coffee b/examples/pug-stylus-coffee/nuxt.config.coffee new file mode 100644 index 0000000000..039a2022ba --- /dev/null +++ b/examples/pug-stylus-coffee/nuxt.config.coffee @@ -0,0 +1,48 @@ +pkg = require('./package') +module.exports = + mode: 'universal' + # + # Headers of the page + # + head: + title: pkg.name + meta: + [ + { + charset: 'utf-8' + } + { + name: 'viewport' + content: 'width=device-width, initial-scale=1' + } + { + hid: 'description' + name: 'description' + content: pkg.description + } + ] + link: + [ + rel: 'icon' + type: 'image/x-icon' + href: '/favicon.ico' + ] + # Customize the progress-bar color + loading: + { + color: '#3B8070' + } + # Global CSS + css: [] + # Plugins to load before mounting the App + plugins: [] + # Nuxt.js modules + modules: + [ + '~/modules/coffeescript' + ] + # Build configuration + build: + # You can extend webpack config here + extend = (config, ctx) -> + pass diff --git a/examples/pug-stylus-coffee/nuxt.config.js b/examples/pug-stylus-coffee/nuxt.config.js new file mode 100644 index 0000000000..3d783db4d2 --- /dev/null +++ b/examples/pug-stylus-coffee/nuxt.config.js @@ -0,0 +1,2 @@ +require('coffeescript/register') +module.exports = require('./nuxt.config.coffee') diff --git a/examples/pug-stylus-coffee/package.json b/examples/pug-stylus-coffee/package.json new file mode 100644 index 0000000000..c63df436f8 --- /dev/null +++ b/examples/pug-stylus-coffee/package.json @@ -0,0 +1,25 @@ +{ + "name": "example-pug-stylus-coffee", + "version": "1.0.0", + "description": "Nuxt.js with Pug Stylus and CoffeeScript", + "author": "Alex Ananiev , Kron Austrum ", + "private": true, + "scripts": { + "dev": "nuxt", + "build": "nuxt build", + "start": "nuxt start", + "generate": "nuxt generate", + "post-update": "yarn upgrade --latest" + }, + "dependencies": { + "nuxt": "latest" + }, + "devDependencies": { + "coffee-loader": "^0.8.0", + "coffeescript": "^2.0.1", + "pug": "^2.0.3", + "pug-plain-loader": "^1.0.0", + "stylus": "^0.54.5", + "stylus-loader": "^3.0.2" + } +} diff --git a/examples/pug-stylus-coffee/pages/README.md b/examples/pug-stylus-coffee/pages/README.md new file mode 100644 index 0000000000..3c7faf56e7 --- /dev/null +++ b/examples/pug-stylus-coffee/pages/README.md @@ -0,0 +1,7 @@ +# PAGES + +This directory contains your Application Views and Routes. +The framework reads all the .vue files inside this directory and create the router of your application. + +More information about the usage of this directory in the documentation: +https://nuxtjs.org/guide/routing diff --git a/examples/pug-stylus-coffee/pages/index.vue b/examples/pug-stylus-coffee/pages/index.vue new file mode 100644 index 0000000000..ee0df7e4ef --- /dev/null +++ b/examples/pug-stylus-coffee/pages/index.vue @@ -0,0 +1,55 @@ + + + + + + diff --git a/examples/pug-stylus-coffee/plugins/README.md b/examples/pug-stylus-coffee/plugins/README.md new file mode 100644 index 0000000000..ca1f9d8a45 --- /dev/null +++ b/examples/pug-stylus-coffee/plugins/README.md @@ -0,0 +1,7 @@ +# PLUGINS + +**This directory is not required, you can delete it if you don't want to use it.** + +This directory contains Javascript plugins that you want to run before mounting the root Vue.js application. + +More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/plugins). diff --git a/examples/pug-stylus-coffee/static/README.md b/examples/pug-stylus-coffee/static/README.md new file mode 100644 index 0000000000..3fc5002348 --- /dev/null +++ b/examples/pug-stylus-coffee/static/README.md @@ -0,0 +1,10 @@ +# STATIC + +**This directory is not required, you can delete it if you don't want to use it.** + +This directory contains your static files. +Each file inside this directory is mapped to `/`. + +Example: `/static/robots.txt` is mapped as `/robots.txt`. + +More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#static). diff --git a/examples/pug-stylus-coffee/static/favicon.ico b/examples/pug-stylus-coffee/static/favicon.ico new file mode 100644 index 0000000000..c785410aa2 Binary files /dev/null and b/examples/pug-stylus-coffee/static/favicon.ico differ diff --git a/examples/pug-stylus-coffee/store/README.md b/examples/pug-stylus-coffee/store/README.md new file mode 100644 index 0000000000..1972d277a2 --- /dev/null +++ b/examples/pug-stylus-coffee/store/README.md @@ -0,0 +1,10 @@ +# STORE + +**This directory is not required, you can delete it if you don't want to use it.** + +This directory contains your Vuex Store files. +Vuex Store option is implemented in the Nuxt.js framework. + +Creating a file in this directory automatically activates the option in the framework. + +More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/vuex-store). diff --git a/examples/pug-stylus-coffee/store/index.coffee b/examples/pug-stylus-coffee/store/index.coffee new file mode 100644 index 0000000000..5b8fb88be6 --- /dev/null +++ b/examples/pug-stylus-coffee/store/index.coffee @@ -0,0 +1,3 @@ +export state = -> + msg: 'Hello from /store/index.coffee!' + msgComputed: 'Hello from /store/index.coffee computed!'