Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var webpack = require('webpack');
- var LiveReloadPlugin = require('webpack-livereload-plugin');
- module.exports = {
- target: 'node',
- entry:['./src/custom-script.js', './src/main.js'],
- output: {
- path: __dirname,
- filename: "build/bundle.js"
- },
- resolve: {
- extensions: ['', '.js', '.jsx', '.json', 'index.json']
- },
- module: {
- loaders: [
- {test: /.json$/, loader: "json-loader"},
- {
- test: /.jsx?$/,
- loader: ['babel-loader'],
- exclude: /node_modules/,
- query: {
- presets: ['react', 'es2015', 'stage-0']
- }
- }
- ]
- },
- plugins: [
- new webpack.DefinePlugin({
- 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
- }),
- new webpack.optimize.DedupePlugin(),
- new webpack.optimize.OccurenceOrderPlugin(),
- new LiveReloadPlugin()
- ]
- };
- import React from 'react';
- import { render } from 'react-dom';
- class SendMail extends React.Component {
- handleSubmit() {
- var send = require('gmail-send')({
- user: 'user@gmail.com', // Your GMail account used to send emails
- pass: 'abcdefghijklmnop', // Application-specific password
- to: '"User" <user@gmail.com>', // Send back to yourself
- // from: '"User" <user@gmail.com>' // from: by default equals to user
- // replyTo:'user@gmail.com' // replyTo: by default undefined
- subject: 'test subject',
- text: 'test text'
- // html: '<b>html text text</b>'
- });
- send({
- subject: 'attached '
- }, function (err, res) {
- console.log('send(): err:', err, '; res:', res);
- });
- }
- render() {
- return (
- <div>
- <button className="button button-primary button-fluid" onClick={this.handleSubmit.bind(this)}>Send code</button>
- </div>
- );
- }
- }
- export default SendMail;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement