From 03f061134891de7f9ed47d194a3fba203260a430 Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 24 Mar 2022 18:55:01 +0000 Subject: [PATCH] feat: webpack --- .eslintignore | 4 +++- webpack.config.js | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 webpack.config.js diff --git a/.eslintignore b/.eslintignore index a6b6b38..923fab4 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,6 @@ dist +build docs node_modules -.eslintrc.js \ No newline at end of file +.eslintrc.js +tsconfig.json \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..a74393b --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,30 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +/* eslint-disable no-undef */ +const path = require("path"); + +module.exports = { + mode: "development", + entry: "./src/index", + devtool: "source-map", + module: { + rules: [ + { + test: /\.tsx?$/, + use: "ts-loader", + exclude: /node_modules/, + }, + ], + }, + output: { + library: { + name: "classchartsapi", + type: "umd", + }, + sourceMapFilename: "classcharts-api.map", + path: path.resolve(__dirname, "build"), + filename: "classcharts-api.js", + }, + resolve: { + extensions: [".ts", ".js"], + }, +};