Skip to content

Commit f1515f4

Browse files
author
Karolis Šarapnickis
authored
Merge pull request #38 from karolis-sh/fix/tweaks
fix: refactor getAssetURL to not use deprecated url method
2 parents dce0ee3 + 1df4858 commit f1515f4

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

.github/workflows/node.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
build:
1414
strategy:
1515
matrix:
16-
node-version: [10.x, 12.x, 14.x]
16+
node-version: [12.x, 14.x]
1717

1818
runs-on: ubuntu-latest
1919
steps:

packages/electron-snowpack/index.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
const url = require('url');
21
const path = require('path');
32

43
exports.getAssetURL = (asset) => {
54
return process.env.NODE_ENV !== 'production'
65
? new URL(asset, `http://localhost:${process.env.SNOWPACK_PORT}/`).toString()
7-
: url.format({
8-
pathname: path.join(__dirname, asset),
9-
protocol: 'file',
10-
slashes: true,
11-
});
6+
: new URL(`file:///${path.join(__dirname, asset)}`).href;
127
};

packages/electron-snowpack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
"snowpack": "^3.0.11"
3131
},
3232
"peerDependencies": {
33-
"electron": "^11.0.0"
33+
"electron": "*"
3434
}
3535
}

0 commit comments

Comments
 (0)