Snowpack: Do not strip non-JS files from `install` allowlist on build

Created on 28 Sep 2020  路  7Comments  路  Source: snowpackjs/snowpack

Original Discussion: https://github.com/pikapkg/snowpack/discussions/1081#discussioncomment-82689
/cc @yukulele

due to this line in the build: https://github.com/pikapkg/snowpack/blob/e217ea5ee72355498656d5dc24c51ead2f084541/snowpack/src/commands/build.ts#L58

Instead of stripping everything, we just want to strip JS assets and leave any CSS. This is a bit tricky, but I bet we can make it work with a simple file extension check (if one exists and is not JS).

bug help wanted

All 7 comments

Hey:) I would be happy to start contributing to snowpack :). I'll try my best to resolve this issue

Thank you! Let me know if I can help provide any guidance!

Sorry for reaching out that late, but i did not find much time to really start and I'm a bit of overwhelmed by the codebase. Could you give me some kind of kick start?

Can we just keep the install config?

installConfig.knownEntrypoints = [...installConfig.install];

no worries @mauricekraus, in retrospect this may not be the best "first issue" :) appreciate you taking a look though!

Is there a workaround for this?
Snowpacks import handling of wasm modules is currently very shaky (partly because it inherits problems in rollup) so I would like to just follow the current web standard that says, fetch the wasm module and instantiate it manually. However, to do that I need to be able to install the wasm module so it's available after build.

@yukulele That doesn't with wasm. Based on two days of testing, importing wasm is completely broken in snowpack/rollup and there is no way to get it to work as specified here https://github.com/WebAssembly/esm-integration (even with @rollup/plugin-wasm) or with a custom snowpack plugin (those does not seem to run at all on files in node_modules). A custom rollup plugin may have worked but I didn't feel like the time to try it was worth it when everything else I've tried already failed. I couldn't either make @snowpack/plugin-webpack follow the behaviour of snowpack for wasm, even when updating it to webpack 5 to be able to use the new asset/resource module type.
That's why I want to just fetch it as is the only currently supported standard until that proposal becomes accepted https://github.com/WebAssembly/esm-integration/tree/master/proposals/esm-integration#improve-ergonomics-of-webassembly-module-instantiation

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FredKSchott picture FredKSchott  路  6Comments

FredKSchott picture FredKSchott  路  3Comments

FredKSchott picture FredKSchott  路  6Comments

FredKSchott picture FredKSchott  路  4Comments

wenyanqi picture wenyanqi  路  5Comments