Setup dev env
This commit is contained in:
parent
33adb75043
commit
57628f55e0
36
.eslintrc.json
Normal file
36
.eslintrc.json
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"commonjs": true,
|
||||
"es2021": true
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 12
|
||||
},
|
||||
"plugins": [
|
||||
"@typescript-eslint"
|
||||
],
|
||||
"rules": {
|
||||
"indent": [
|
||||
"error",
|
||||
4
|
||||
],
|
||||
"linebreak-style": [
|
||||
"error",
|
||||
"windows"
|
||||
],
|
||||
"quotes": [
|
||||
"error",
|
||||
"single"
|
||||
],
|
||||
"semi": [
|
||||
"error",
|
||||
"always"
|
||||
]
|
||||
}
|
||||
}
|
14
html/index.html
Normal file
14
html/index.html
Normal file
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<!-- Push content here -->
|
||||
</main>
|
||||
<script src="/bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
5104
package-lock.json
generated
Normal file
5104
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
38
package.json
Normal file
38
package.json
Normal file
@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "news_channel",
|
||||
"version": "1.0.0",
|
||||
"description": "Wii News Channel recreated using JS",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start:dev": "webpack-dev-server",
|
||||
"build": "webpack"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gitea.arnweb.nl/arne/news_channel.git"
|
||||
},
|
||||
"keywords": [
|
||||
"news"
|
||||
],
|
||||
"author": "Arne van Iterson",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"axios": "^0.21.1",
|
||||
"css-loader": "^5.0.1",
|
||||
"jquery": "^3.5.1",
|
||||
"sass": "^1.32.4",
|
||||
"sass-loader": "^10.1.1",
|
||||
"style-loader": "^2.0.0",
|
||||
"typed.js": "^2.0.11",
|
||||
"webpack": "^5.15.0",
|
||||
"webpack-cli": "^4.3.1",
|
||||
"webpack-dev-server": "^3.11.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^4.13.0",
|
||||
"@typescript-eslint/parser": "^4.13.0",
|
||||
"eslint": "^7.18.0",
|
||||
"ts-loader": "^8.0.14",
|
||||
"typescript": "^4.1.3"
|
||||
}
|
||||
}
|
0
scss/index.scss
Normal file
0
scss/index.scss
Normal file
13
src/index.ts
Normal file
13
src/index.ts
Normal file
@ -0,0 +1,13 @@
|
||||
const axios = require('axios').default;
|
||||
const parser = new DOMParser();
|
||||
|
||||
axios.get('https://nieuws.nl/feed/')
|
||||
.then(function (response: any) {
|
||||
const news = parser.parseFromString(response.data, 'text/xml');
|
||||
news.querySelectorAll("item").forEach((item: any) => {
|
||||
console.log(item.title);
|
||||
});
|
||||
})
|
||||
.catch(function (error: any) {
|
||||
console.log(error);
|
||||
});
|
10
tsconfig.json
Normal file
10
tsconfig.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist/",
|
||||
"noImplicitAny": true,
|
||||
"module": "es6",
|
||||
"target": "es5",
|
||||
"jsx": "react",
|
||||
"allowJs": true
|
||||
}
|
||||
}
|
19
webpack.config.js
Normal file
19
webpack.config.js
Normal file
@ -0,0 +1,19 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
entry: './src/index.ts',
|
||||
module: {
|
||||
rules: [{
|
||||
test: /\.tsx?$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/,
|
||||
}, ],
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.tsx', '.ts', '.js'],
|
||||
},
|
||||
output: {
|
||||
filename: 'bundle.js',
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user