Skip to content

Commit 191a76d

Browse files
jakebaileyandrewbranch
authored andcommitted
Use go.mod ignore directive instead of postinstall (microsoft#1585)
1 parent 7e8d6cd commit 191a76d

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

Herebyfile.mjs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -477,16 +477,6 @@ export const checkFormat = task({
477477
},
478478
});
479479

480-
export const postinstall = task({
481-
name: "postinstall",
482-
hiddenFromTaskList: true,
483-
run: () => {
484-
// Ensure the go command doesn't waste time looking into node_modules.
485-
// Remove once https://github.com/golang/go/issues/42965 is fixed.
486-
fs.writeFileSync(path.join(__dirname, "node_modules", "go.mod"), `module example.org/ignoreme\n`);
487-
},
488-
});
489-
490480
/**
491481
* @param {string} localBaseline Path to the local copy of the baselines
492482
* @param {string} refBaseline Path to the reference copy of the baselines

go.mod

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,12 @@ tool (
2828
golang.org/x/tools/cmd/stringer
2929
mvdan.cc/gofumpt
3030
)
31+
32+
ignore (
33+
./_extension
34+
./_packages
35+
./_submodules
36+
./built
37+
./coverage
38+
node_modules
39+
)

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"which": "^5.0.0"
2020
},
2121
"scripts": {
22-
"postinstall": "hereby postinstall",
2322
"build": "hereby build",
2423
"build:watch": "hereby build:watch",
2524
"build:watch:debug": "hereby build:watch --debug",

0 commit comments

Comments
 (0)