Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
deno support
Browse files Browse the repository at this point in the history
  • Loading branch information
hsl0 committed May 2, 2021
1 parent 8d4e74b commit 54730b7
Show file tree
Hide file tree
Showing 28 changed files with 4,380 additions and 1,156 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ out
.yarn/install-state.gz
.pnp.*

## VScode
.vscode/
*.code-workspace

# Local History for Visual Studio Code
.history/

Expand Down
4 changes: 1 addition & 3 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
.npmignore
.vscode/
.eslintrc.json
webpack.config.js
tsconfig-commonjs.json
tsconfig.json
builder/
test/
src/

Expand Down
68 changes: 68 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
// IntelliSense를 사용하여 가능한 특성에 대해 알아보세요.
// 기존 특성에 대한 설명을 보려면 가리킵니다.
// 자세한 내용을 보려면 https://go.microsoft.com/fwlink/?linkid=830387을(를) 방문하세요.
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Node",
"program": "${file}",
"skipFiles": [
"<node_internals>/**"
],
"outFiles": [
"${workspaceFolder}/dist/node/**/*.js"
],
"preLaunchTask": "npm: build-node"
},
{
"type": "firefox",
"request": "launch",
"reAttach": true,
"name": "Launch Firefox localhost",
"url": "http://localhost/index.html",
"webRoot": "${workspaceFolder}",
"preLaunchTask": "npm: build-web-dev"
},
{
"type": "firefox",
"request": "launch",
"reAttach": true,
"name": "Launch Firefox index.html",
"file": "${file}",
"preLaunchTask": "npm: build-web-dev"
},
{
"name": "Launch Edge",
"request": "launch",
"type": "pwa-msedge",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}",
"preLaunchTask": "npm: build-web-dev"
},
{
"name": "Launch Deno",
"type": "pwa-node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "deno",
"runtimeArgs": [
"run",
"--inspect-brk",
"--allow-all",
"${file}"
],
"attachSimplePort": 9229
},
{
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}",
"preLaunchTask": "npm: build-web-dev"
}
]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"deno.unstable": false,
"deno.enable": true,
"deno.lint": false
}
45 changes: 45 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "build",
"group": "build",
"problemMatcher": [],
"label": "npm: build",
"detail": "(npm run lint && (tsc & tsc -p tsconfig-commonjs.json)) & webpack"
},
{
"type": "npm",
"script": "build-ecma",
"group": "build",
"problemMatcher": [],
"label": "npm: build-ecma",
"detail": "npm run lint && tsc"
},
{
"type": "npm",
"script": "build-web-dev",
"group": "build",
"problemMatcher": [],
"label": "npm: build-web-dev",
"detail": "webpack --mode development"
},
{
"type": "npm",
"script": "build-web",
"group": "build",
"problemMatcher": [],
"label": "npm: build-web",
"detail": "webpack"
},
{
"type": "npm",
"script": "build-node",
"group": "build",
"problemMatcher": [],
"label": "npm: build-node",
"detail": "npm run lint && tsc -p tsconfig-commonjs.json"
}
]
}
12 changes: 12 additions & 0 deletions builder/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
"@babel/preset-typescript"
],
"plugins": [
["babel-plugin-replace-import-extension", {
"extMapping": {
".ts": ".js"
}
}]
]
}
2 changes: 2 additions & 0 deletions builder/dist/web.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions builder/dist/web.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions builder/node.babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"presets": [
["@babel/preset-env", {
"targets": "maintained node versions"
}],
"@babel/preset-typescript"
],
"plugins": [
["babel-plugin-replace-import-extension", {
"extMapping": {
".ts": ".js"
}
}]
]
}
6 changes: 4 additions & 2 deletions tsconfig.json → builder/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
"lib": ["ESNext", "DOM"],
"module": "ES2015",
"sourceMap": true,
"outDir": "dist",
"outDir": "../dist",
"declaration": true,
"emitDeclarationOnly": true,
"isolatedModules": true,
"downlevelIteration": true,
"moduleResolution": "node"
},
"include": [
"./src/**/*"
"../src/**/*"
]
}
18 changes: 16 additions & 2 deletions webpack.config.js → builder/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,25 @@ const config = {
rules: [
{
test: /\.ts$/,
loader: 'ts-loader'
use: {
loader: "babel-loader",
options: {
presets: [
"@babel/preset-typescript"
],
plugins: [
["babel-plugin-replace-import-extension", {
extMapping: {
".ts": ".js"
}
}]
]
}
}
},
{
enforce: "pre",
test: /\.js$/,
test: /\.m?js$/,
loader: 'source-map-loader'
}
]
Expand Down
Loading

0 comments on commit 54730b7

Please sign in to comment.