Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
prasanthmj committed Mar 25, 2019
1 parent 1b613e5 commit c3f36c9
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/node_modules
.DS_Store
Thumbs.db
.clasp.json
10 changes: 10 additions & 0 deletions appsscript.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"timeZone": "America/New_York",
"dependencies": {
},
"webapp": {
"access": "MYSELF",
"executeAs": "USER_DEPLOYING"
},
"exceptionLogging": "STACKDRIVER"
}
24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "AppsPackExample1",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"gas": "webpack --config webpack.gas.js ",
"deploy": "npm run gas && cd dist && clasp push && clasp open --webapp"
},
"keywords": [],
"author": "",
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.4.0",
"@babel/preset-env": "^7.4.2",
"babel-loader": "^8.0.5",
"copy-webpack-plugin": "^5.0.1",
"webpack": "^4.29.6",
"webpack-cli": "^3.3.0"
},
"dependencies": {
"@babel/polyfill": "^7.4.0"
}
}
5 changes: 5 additions & 0 deletions server/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function doGet()
{
var output = AppLib.getObjectValues();
return ContentService.createTextOutput(output);
}
10 changes: 10 additions & 0 deletions server/lib.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function getObjectValues()
{
let options = Object.assign({}, {source_url:null, header_row:1}, {content:"Hello, World"});

return(JSON.stringify(options));
}

export {
getObjectValues
};
45 changes: 45 additions & 0 deletions webpack.gas.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
var path = require('path');
const CopyPlugin = require('copy-webpack-plugin');

module.exports = {
mode: 'development',
entry:{
lib:'./server/lib.js'
},
output:
{
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'var',
library: 'AppLib'
},
module:
{
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: [
[
'@babel/preset-env',
{
useBuiltIns: 'usage'
}
]
]
}
}
}
]
},
plugins: [
new CopyPlugin([
'server/api.js',
'appsscript.json',
'.clasp.json'
])
]
};

0 comments on commit c3f36c9

Please sign in to comment.