This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
writing() { | |
this.config.set('configuration', this.options.env.configuration); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ... */ | |
module.exports = class WebpackGenerator extends Generator { | |
/* ... */ | |
install() { | |
// => Installs dependencies using yarn | |
this.installDependencies({ | |
npm: false, | |
yarn: true, | |
bower: false | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
}); |
NewerOlder