wasm-pack-plugin icon indicating copy to clipboard operation
wasm-pack-plugin copied to clipboard

Cannot find wasm file with custom file paths

Open Norlock opened this issue 5 years ago • 1 comments

I have a directory in my source public, and in directory public I have my index.html. My scripts are located in public/dist. However when bundled it looks for the wasm file in the public dir instead of in public/dist where it is located.

webpack.config.zip

Norlock avatar Feb 07 '21 10:02 Norlock

@Norlock I guess you first need output.path to point to public/dist. Also, you need publicPath only when you serve contents from a specific subdirectory. Assuming your public (or public/dist) is not subdirectory but a document root for your server application, I don't think you need publicPath. Sorry if none of my words are irrelevant for I haven't used your config to actually test it out. Also, if you are using Webpack 5, make sure to specify experiments.syncWebAssembly: true.

minagawah avatar Mar 23 '21 23:03 minagawah