Skip to content

Instantly share code, notes, and snippets.

View misterdev's full-sized avatar
🎧

Devid Farinelli misterdev

🎧
View GitHub Profile
@misterdev
misterdev / MainApplication.java
Created April 15, 2020 12:02 — forked from mczernek/MainApplication.java
MainApplication.java changes to support unimodules for RN>=0.60
package com.doingmything;
// "com.doingmything" should be your app package name
import com.doingmything.generated.BasePackageList;
import android.app.Application;
import android.util.Log;
import org.unimodules.adapters.react.ModuleRegistryAdapter;
import org.unimodules.adapters.react.ReactModuleRegistryProvider;
@misterdev
misterdev / index.js
Last active March 21, 2019 16:05
1.5
constructor(args, opts) {
super(args, opts);
opts.env.configurations = {
// => each key inside this object will generate a webpack
// => configuration file
dev: {
topScope: [
// => We will place here any code like
// => function definitions and imports
// => that we use in our configuration
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="/favicon.ico">
<title><%= title %></title>
</head>
<body>
module.exports = (answers) => {
const { name, entry, inFolder: src } = answers;
return ({
"name": name,
"version": "1.0.0",
"main": `${src}/${entry}.js`,
"license": "MIT",
"scripts": {
"serve": "webpack-dev-server --mode development --progress --hot --open",
"build": "webpack --mode production --progress",
writing() {
this.config.set('configuration', this.options.env.configuration);
}
@misterdev
misterdev / index.js
Last active March 21, 2019 17:00
10
/* ... */
module.exports = class WebpackGenerator extends Generator {
/* ... */
install() {
// => Installs dependencies using yarn
this.installDependencies({
npm: false,
yarn: true,
bower: false
});
const Generator = require('yeoman-generator');
const { List, Input, InputValidate } = require('@webpack-cli/webpack-scaffold');
// => Import our webpack config generator
const createWebpackConfig = require('./config/webpack');
module.exports = class WebpackGenerator extends Generator {
/* ... */
prompting() {
return this.prompt([ /* ... */ ]).then (answers => {
@misterdev
misterdev / config-webpack-config.js
Last active March 21, 2019 14:50
webpack config
module.exports = (answers) => {
const { name, entry, inFolder: src, outFolder: dist, publicFolder } = answers;
return {
entry: `"./${src}/${entry}.js"`,
mode: '"development"',
module: {
rules: [{
test: "/\\.js$/",
exclude: "/node_modules/",
module.exports = class WebpackGenerator extends Generator {
constructor(args, opts) {
/* ... */
// => These are the defaults values
this.defaults = {
name: 'my-vue-project',
inFolder: 'src',
entry: 'main',
outFolder: 'dist',
prompting() {
/* ... */
return this.prompt([
/* ... */
]).then (answers => {
this.answers = answers;
this.answers.name = (answers.name !== '') ? answers.name.toLowerCase() : 'my-vue-project';
this.answers.entry = (answers.entry !== '') ? answers.entry : 'main';
// => We do this for each answer
});