Skip to content

Commit

Permalink
Move away from Node.js built-ins
Browse files Browse the repository at this point in the history
This makes it possible to easily build this project using tools such as Webpack 5.
  • Loading branch information
Tpt authored Jul 14, 2022
1 parent 4d73d89 commit 300a848
Show file tree
Hide file tree
Showing 4 changed files with 587 additions and 39 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,17 @@ jobs:
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true

webpack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-webpack-modules-${{ hashFiles('**/yarn.lock') }}
- uses: actions/setup-node@v3
with:
node-version: 18.x
- run: yarn install
- run: npx webpack
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@
"pre-commit": "^1.2.2",
"rdf-data-factory": "^1.0.2",
"ts-jest": "^28.0.0",
"ts-loader": "^9.3.1",
"tslint": "^6.0.0",
"tslint-eslint-rules": "^5.3.1",
"typescript": "^4.0.2"
"typescript": "^4.0.2",
"webpack": "^5.73.0",
"webpack-cli": "^4.10.0"
},
"jest": {
"globals": {
Expand Down Expand Up @@ -73,7 +76,7 @@
},
"dependencies": {
"rdf-literal": "^1.2.0",
"sparqljson-parse": "^1.6.0"
"sparqljson-parse": "^2.0.0"
},
"sideEffects": false
}
22 changes: 22 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const path = require('path');

module.exports = {
entry: './lib/Converter.ts',
mode: 'development',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
output: {
filename: 'out.js',
path: path.resolve(__dirname, 'dist'),
},
};
Loading

0 comments on commit 300a848

Please sign in to comment.