Created
December 13, 2016 02:32
-
-
Save KerryRitter/4aed5f0029a0c0e21b31f329ea3b6912 to your computer and use it in GitHub Desktop.
webpack typescript test
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
import { Person } from "./person"; | |
import "test"; | |
const person = new Person("Kerry", "Ritter"); | |
alert(person.fullName); |
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
/******/ (function(modules) { // webpackBootstrap | |
/******/ // The module cache | |
/******/ var installedModules = {}; | |
/******/ | |
/******/ // The require function | |
/******/ function __webpack_require__(moduleId) { | |
/******/ | |
/******/ // Check if module is in cache | |
/******/ if(installedModules[moduleId]) | |
/******/ return installedModules[moduleId].exports; | |
/******/ | |
/******/ // Create a new module (and put it into the cache) | |
/******/ var module = installedModules[moduleId] = { | |
/******/ exports: {}, | |
/******/ id: moduleId, | |
/******/ loaded: false | |
/******/ }; | |
/******/ | |
/******/ // Execute the module function | |
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | |
/******/ | |
/******/ // Flag the module as loaded | |
/******/ module.loaded = true; | |
/******/ | |
/******/ // Return the exports of the module | |
/******/ return module.exports; | |
/******/ } | |
/******/ | |
/******/ | |
/******/ // expose the modules object (__webpack_modules__) | |
/******/ __webpack_require__.m = modules; | |
/******/ | |
/******/ // expose the module cache | |
/******/ __webpack_require__.c = installedModules; | |
/******/ | |
/******/ // __webpack_public_path__ | |
/******/ __webpack_require__.p = ""; | |
/******/ | |
/******/ // Load entry module and return exports | |
/******/ return __webpack_require__(0); | |
/******/ }) | |
/************************************************************************/ | |
/******/ ([ | |
/* 0 */ | |
/***/ function(module, exports) { | |
System.register(["./person", "test"], function (exports_1, context_1) { | |
"use strict"; | |
var __moduleName = context_1 && context_1.id; | |
var person_1, person; | |
return { | |
setters: [ | |
function (person_1_1) { | |
person_1 = person_1_1; | |
}, | |
function (_1) { | |
} | |
], | |
execute: function () { | |
person = new person_1.Person("Kerry", "Ritter"); | |
alert(person.fullName); | |
} | |
}; | |
}); | |
/***/ } | |
/******/ ]); | |
//# sourceMappingURL=bundle.js.map |
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
export class Person { | |
public constructor( | |
public firstName: string, | |
public lastName: string | |
) { | |
} | |
public get fullName(): string { | |
return `${this.firstName} ${this.lastName}`; | |
} | |
} |
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
[1, 2, 3, 4].forEach(element => { | |
alert(element); | |
}); |
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 = { | |
entry: "./app.ts", | |
output: { | |
filename: "bundle.js" | |
}, | |
// Currently we need to add ".ts" to the resolve.extensions array. | |
resolve: { | |
extensions: ["", ".ts", ".tsx", ".js", ".jsx"] | |
}, | |
// Source maps support ("inline-source-map" also works) | |
devtool: "source-map", | |
// Add the loader for .ts files. | |
module: { | |
loaders: [ | |
{ | |
test: /\.ts$/, | |
loader: "awesome-typescript-loader" | |
} | |
] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment