Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't create .gitignore in pkg directory #1408

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions docs/src/commands/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
The `wasm-pack build` command creates the files necessary for JavaScript
interoperability and for publishing a package to npm. This involves compiling
your code to wasm and generating a pkg folder. This pkg folder will contain the
wasm binary, a JS wrapper file, your `README`, and a `package.json` file.

The `pkg` directory is automatically `.gitignore`d by default, since it contains
build artifacts which are not intended to be checked into version
control.<sup>[0](#footnote-0)</sup>
wasm binary, a JS wrapper file, your `README`, and a `package.json` file.<sup>[0](#footnote-0)</sup>

## Path

Expand Down Expand Up @@ -140,6 +136,5 @@ wasm-pack build examples/js-hello-world --mode no-install -- --offline

<hr style="font-size: 1.5em; margin-top: 2.5em"/>

<sup id="footnote-0">0</sup> If you need to include additional assets in the pkg
directory and your NPM package, we intend to have a solution for your use case
soon. [↩](#wasm-pack-build)
<sup id="footnote-0">0</sup> In contrast to previous releases, a `.gitignore`
file is no longer created in the `pkg` directory. [↩](#wasm-pack-build)
1 change: 0 additions & 1 deletion src/command/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ fn find_manifest_from_cwd() -> Result<PathBuf> {
pub fn create_pkg_dir(out_dir: &Path) -> Result<()> {
let _ = fs::remove_file(out_dir.join("package.json")); // Clean up package.json from previous runs
fs::create_dir_all(&out_dir)?;
fs::write(out_dir.join(".gitignore"), "*")?;
Ok(())
}

Expand Down
Loading