TypeScript basic setup

This commit is contained in:
Madeorsk 2018-11-01 18:02:33 +01:00
commit 26ed0d47be
6 changed files with 2867 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
node_modules/
dist/

16
package.json Normal file
View File

@ -0,0 +1,16 @@
{
"name": "webpacktest",
"version": "1.0.0",
"private": true,
"license": "MIT",
"scripts": {
"build": "webpack --mode production",
"watch": "webpack --mode development --watch"
},
"devDependencies": {
"ts-loader": "^5.3.0",
"typescript": "^3.1.5",
"webpack": "^4.23.1",
"webpack-cli": "^3.1.2"
}
}

1
src/main.ts Normal file
View File

@ -0,0 +1 @@
console.log("Hello World!");

11
tsconfig.json Normal file
View File

@ -0,0 +1,11 @@
{
"compilerOptions": {
"outDir": "./dist/",
"sourceMap": true,
"noImplicitAny": true,
"module": "es6",
"target": "es5",
"jsx": "react",
"allowJs": true
}
}

22
webpack.config.js Normal file
View File

@ -0,0 +1,22 @@
const path = require("path");
module.exports = {
entry: "./src/main.ts",
devtool: "inline-source-map",
module: {
rules: [
{
test: /\.tsx?$/,
use: "ts-loader",
exclude: "/node_modules/"
}
]
},
resolve: {
extensions: [".tsx", ".ts", ".js"]
},
output: {
filename: "bundle.js",
path: path.resolve(__dirname, "dist")
}
};

2815
yarn.lock Normal file

File diff suppressed because it is too large Load Diff