🚀 bootstrap workspace

This commit is contained in:
platane
2020-07-16 01:19:21 +02:00
commit e9654e7e66
14 changed files with 7679 additions and 0 deletions

1
packages/demo/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
webpack.config.js

13
packages/demo/index.ts Normal file
View File

@@ -0,0 +1,13 @@
// import { generateGrid } from "@snk/compute/generateGrid";
import { generateGrid } from "@snk/compute/generateGrid";
console.log("hello world");
export const run = async (a: number) => {
generateGrid(100, 100);
console.log(a, generateGrid(100, 100));
};
run(1);

View File

@@ -0,0 +1,19 @@
{
"name": "@snk/demo",
"version": "1.0.0",
"dependencies": {
"@snk/compute": "1.0.0"
},
"devDependencies": {
"webpack": "4.43.0",
"webpack-cli": "3.3.12",
"webpack-dev-server": "3.11.0",
"ts-loader": "8.0.1",
"html-webpack-plugin": "4.3.0"
},
"scripts": {
"prepare": "tsc webpack.config.ts",
"build": "yarn prepare ; webpack",
"dev": "yarn prepare ; webpack-dev-server --port ${PORT-3000}"
}
}

View File

@@ -0,0 +1,43 @@
import * as path from "path";
// @ts-ignore
import * as HtmlWebpackPlugin from "html-webpack-plugin";
import type { Configuration } from "webpack";
const basePathname = (process.env.BASE_PATHNAME || "")
.split("/")
.filter(Boolean);
const config: Configuration = {
mode: "development",
entry: "./index",
resolve: { extensions: [".ts", ".js"] },
output: {
path: path.join(__dirname, "../../dist/demo"),
filename: "[contenthash].js",
publicPath: "/" + basePathname.map((x) => x + "/").join(""),
},
module: {
rules: [
{
exclude: /node_modules/,
test: /\.(js|ts)$/,
loader: "ts-loader",
},
],
},
plugins: [
// game
new HtmlWebpackPlugin({
title: "demo",
filename: "index.html",
meta: {
viewport: "width=device-width, initial-scale=1, shrink-to-fit=no",
},
}),
],
devtool: false,
};
export default config;