Skip to content

Commit

Permalink
build(webpack): adds shebang loader
Browse files Browse the repository at this point in the history
Added a shebang-loader (webpack plugin) to avoid
webpack disappearing the hashbang from the standard bin
script of the example package.
Without this, if you have the shebang at the beginning
of your Typescript file such as this
And then build the project, it would just disappear, but
with the shebang loader it is preserved.

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed Dec 1, 2020
1 parent a143079 commit 31be060
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
36 changes: 35 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"npm-run-all": "4.1.5",
"prettier": "2.0.5",
"secp256k1": "4.0.0",
"shebang-loader": "0.0.1",
"source-map-loader": "0.2.4",
"tap": "14.10.6",
"tape": "5.0.1",
Expand Down
4 changes: 4 additions & 0 deletions webpack.dev.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ module.exports = {
devtool: "inline-source-map",
module: {
rules: [
{
test: /\.(js|ts)$/,
use: ["shebang-loader"],
},
{
test: /\.ts$/,
exclude: /node_modules/,
Expand Down
4 changes: 4 additions & 0 deletions webpack.prod.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ module.exports = {
devtool: "source-map",
module: {
rules: [
{
test: /\.(js|ts)$/,
use: ["shebang-loader"],
},
{
test: /\.ts$/,
exclude: /node_modules/,
Expand Down

0 comments on commit 31be060

Please sign in to comment.