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
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
<!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 = 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
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 | |
}); |
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'); | |
// => We import the helper functions | |
const { List, Input } = require('@webpack-cli/webpack-scaffold'); | |
module.exports = class WebpackGenerator extends Generator { | |
constructor(args, opts) { /* ... */ } | |
prompting() { | |
return this.prompt([ | |
// => Input, asks the user to write a response |
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'); | |
// => We include InputValidate | |
const { List, Input, InputValidate } = require('@webpack-cli/webpack-scaffold'); | |
module.exports = class WebpackGenerator extends Generator { | |
/* ... */ | |
prompting() { | |
// => We create a validator function that takes the user input as parameter | |
const validateName = (value) => { | |
// => If it contains space it's not a valid name |
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'); | |
module.exports = class WebpackGenerator extends Generator { | |
constructor(args, opts) { | |
super(args, opts); | |
// => We will initialize our generator here | |
} | |
prompting() { | |
// => This is were we will print the questions to get the user preferences | |
} |
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 |
NewerOlder