Skip to content

Commit

Permalink
refactor: ♻️ code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
thkruz committed Jul 9, 2022
1 parent 0c87700 commit 6d9cc64
Show file tree
Hide file tree
Showing 17 changed files with 72 additions and 543 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"description": "Orbital Object Toolkit including SGP4 Propagator and Coordinate Transforms",
"main": "dist/ootk.js",
"scripts": {
"build": "node ./scripts/cleanup.js && tsc",
"build:umd": "node ./scripts/cleanup.js && tsc && node node_modules/webpack/bin/webpack.js --config ./scripts/umd.js",
"build": "node ./scripts/cleanup.js && tsc && node --openssl-legacy-provider node_modules/webpack/bin/webpack.js --config ./scripts/webpack.js",
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"lint:test": "eslint test",
Expand Down
123 changes: 0 additions & 123 deletions scripts/umd.js

This file was deleted.

45 changes: 45 additions & 0 deletions scripts/webpack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
let config = {
module: {
rules: [
{
test: /\.m?js$/u,
// eslint-disable-next-line prefer-named-capture-group
exclude: /(node_modules|bower_components)/u,
use: {
loader: 'babel-loader',
},
},
],
},
resolve: {
alias: {
// eslint-disable-next-line no-path-concat, no-undef
'@src': __dirname + '/../src',
},
},
};

const lib = {
...config,
name: 'ootk',
mode: 'production',
entry: {
ootk: ['./lib/ootk.js'],
},
output: {
filename: '[name].js',
library: 'Ootk',
libraryTarget: 'umd',
// eslint-disable-next-line no-path-concat, no-undef
path: __dirname + '/../dist',
globalObject: 'this',
},
optimization: {
minimize: true,
},
stats: 'errors-warnings',
};

// Return Array of Configurations
// eslint-disable-next-line no-undef
module.exports = [lib];
Loading

0 comments on commit 6d9cc64

Please sign in to comment.