Skip to content

Instantly share code, notes, and snippets.

View misterdev's full-sized avatar
🎧

Devid Farinelli misterdev

🎧
View GitHub Profile
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 / 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
});
writing() {
this.config.set('configuration', this.options.env.configuration);
}
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",
<!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>
@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
@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;