This sets up Typescript scripting. As a sideeffect, this also adds a local webserver that can be used to develop maps locally.pull/6/head
parent
83a5dea24d
commit
62680f5916
@ -0,0 +1 @@ |
||||
/node_modules/ |
Before Width: | Height: | Size: 158 KiB |
Before Width: | Height: | Size: 175 KiB |
Before Width: | Height: | Size: 44 KiB |
@ -0,0 +1,25 @@ |
||||
{ |
||||
"name": "workadventure-map-starter-kit", |
||||
"version": "1.0.0", |
||||
"main": "index.js", |
||||
"license": "MIT", |
||||
"devDependencies": { |
||||
"@workadventure/iframe-api-typings": "^1.2.0", |
||||
"eslint": "^6.8.0", |
||||
"html-webpack-plugin": "^4.3.0", |
||||
"ts-loader": "^6.2.2", |
||||
"ts-node": "^8.10.2", |
||||
"typescript": "^3.8.3", |
||||
"webpack": "^4.42.1", |
||||
"webpack-cli": "^3.3.11", |
||||
"webpack-dev-server": "^3.10.3", |
||||
"webpack-merge": "^4.2.2" |
||||
}, |
||||
"scripts": { |
||||
"start": "webpack-dev-server --open", |
||||
"build": "webpack --config webpack.prod.js", |
||||
"test": "ts-node node_modules/jasmine/bin/jasmine --config=jasmine.json", |
||||
"lint": "node_modules/.bin/eslint src/ . --ext .ts", |
||||
"fix": "node_modules/.bin/eslint --fix src/ . --ext .ts" |
||||
} |
||||
} |
@ -0,0 +1,4 @@ |
||||
/// <reference path="../node_modules/@workadventure/iframe-api-typings/iframe_api.d.ts" />
|
||||
|
||||
console.log('Script started successfully'); |
||||
WA.openCoWebSite('https://workadventu.re'); |
@ -0,0 +1,25 @@ |
||||
{ |
||||
"compilerOptions": { |
||||
"outDir": "./dist/", |
||||
"sourceMap": true, |
||||
"moduleResolution": "node", |
||||
"module": "CommonJS", |
||||
"target": "ES2015", |
||||
"declaration": false, |
||||
"downlevelIteration": true, |
||||
"jsx": "react", |
||||
"allowJs": true, |
||||
|
||||
"strict": true, /* Enable all strict type-checking options. */ |
||||
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ |
||||
"strictNullChecks": true, /* Enable strict null checks. */ |
||||
"strictFunctionTypes": true, /* Enable strict checking of function types. */ |
||||
"strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ |
||||
"strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ |
||||
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ |
||||
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ |
||||
|
||||
"noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ |
||||
"noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */ |
||||
} |
||||
} |
@ -0,0 +1,60 @@ |
||||
const path = require('path'); |
||||
const webpack = require('webpack'); |
||||
const HtmlWebpackPlugin = require('html-webpack-plugin'); |
||||
|
||||
module.exports = { |
||||
entry: './src/index.ts', |
||||
devtool: 'inline-source-map', |
||||
devServer: { |
||||
contentBase: '.', |
||||
//host: '0.0.0.0',
|
||||
host: 'localhost', |
||||
//sockPort: 80,
|
||||
disableHostCheck: true, |
||||
headers: { |
||||
"Access-Control-Allow-Origin": "*", |
||||
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS", |
||||
"Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization" |
||||
} |
||||
}, |
||||
module: { |
||||
rules: [ |
||||
{ |
||||
test: /\.tsx?$/, |
||||
use: 'ts-loader', |
||||
exclude: /node_modules/, |
||||
}, |
||||
], |
||||
}, |
||||
resolve: { |
||||
extensions: [ '.tsx', '.ts', '.js' ], |
||||
}, |
||||
output: { |
||||
filename: 'script.js', |
||||
path: path.resolve(__dirname, 'dist'), |
||||
publicPath: '/' |
||||
}, |
||||
/*externals:[ |
||||
require('webpack-require-http') |
||||
],*/ |
||||
plugins: [ |
||||
/*new webpack.ProvidePlugin({ |
||||
WA: ['@workadventure/iframe-api-typings', 'window.WA'] |
||||
}),*/ |
||||
/*new webpack.EnvironmentPlugin({ |
||||
'API_URL': null, |
||||
'PUSHER_URL': undefined, |
||||
'UPLOADER_URL': null, |
||||
'ADMIN_URL': null, |
||||
'DEBUG_MODE': null, |
||||
'STUN_SERVER': null, |
||||
'TURN_SERVER': null, |
||||
'TURN_USER': null, |
||||
'TURN_PASSWORD': null, |
||||
'JITSI_URL': null, |
||||
'JITSI_PRIVATE_MODE': null, |
||||
'START_ROOM_URL': null |
||||
})*/ |
||||
], |
||||
|
||||
}; |
Loading…
Reference in new issue