@@ -85,6 +85,9 @@ struct PackagingPlanner {
85
85
try FileManager . default. removeItem ( atPath: to)
86
86
}
87
87
try FileManager . default. copyItem ( atPath: from, toPath: to)
88
+ try FileManager . default. setAttributes (
89
+ [ . modificationDate: Date ( ) ] , ofItemAtPath: to
90
+ )
88
91
}
89
92
90
93
private static func createDirectory( atPath: String ) throws {
@@ -191,31 +194,9 @@ struct PackagingPlanner {
191
194
}
192
195
packageInputs. append ( wasm)
193
196
194
- // Write package.json
195
- let packageJSON = make. addTask (
196
- inputFiles: [ selfPath] , inputTasks: [ outputDirTask] ,
197
- output: outputDir. appending ( path: " package.json " ) . path
198
- ) {
199
- let packageJSON = """
200
- {
201
- " name " : " \( options. packageName ?? packageId. lowercased ( ) ) " ,
202
- " version " : " 0.0.0 " ,
203
- " type " : " module " ,
204
- " exports " : {
205
- " . " : " ./index.js " ,
206
- " ./wasm " : " ./ \( wasmFilename) "
207
- },
208
- " dependencies " : {
209
- " @bjorn3/browser_wasi_shim " : " ^0.4.1 "
210
- }
211
- }
212
- """
213
- try packageJSON. write ( toFile: $0. output, atomically: true , encoding: . utf8)
214
- }
215
- packageInputs. append ( packageJSON)
216
-
217
197
// Instantiate the template files
218
198
for (template, output) in [
199
+ ( \TemplateContext . package_json, " package.json " ) ,
219
200
( \TemplateContext . index_js, " index.js " ) ,
220
201
( \TemplateContext . index_d_ts, " index.d.ts " ) ,
221
202
( \TemplateContext . instantiate_js, " instantiate.js " ) ,
0 commit comments