Skip to content

Instantly share code, notes, and snippets.

View luiguild's full-sized avatar
🔥

Luigui Delyer luiguild

🔥
View GitHub Profile
export default {
name: 'Page',
async asyncData (context) {
try {
let something = false
// some business logic
if (!something) return context.error({ statusCode: 404 })
return something
@luiguild
luiguild / webpack.config.js
Last active February 27, 2024 22:11
NS 7 + Vue - webpack.config.js with HMR in <template> and <style>
const { join, relative, resolve, sep } = require('path')
const webpack = require('webpack')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
const TerserPlugin = require('terser-webpack-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const NsVueTemplateCompiler = require('nativescript-vue-template-compiler')
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@luiguild
luiguild / logger.js
Last active November 16, 2018 18:03
Simple logger module and VuePlugin that check NODE_ENV to show console.log()
const prefix = process.env.PREFIX
const nodeEnv = process.env.NODE_ENV
let logCounter = 0
let errorCounter = 0
let fatalCounter = 0
let warnCounter = 0
export const vLogger = {
install (Vue, options) {
@luiguild
luiguild / vue.cson
Last active June 13, 2018 17:53
vue.cson personalization from atom language-vue plugin
".text.html.vue":
"Vue Component":
"prefix": "template"
"body": """
<template lang="${1:pug}">
</template>
<script>
// import {
// mapGetters,