Snowpack: Add tests for our Babel plugin

Created on 15 Jan 2020  Â·  6Comments  Â·  Source: snowpackjs/snowpack

Original Discussion: https://www.pika.dev/npm/snowpack/discuss/44
/cc @Monchi, @FredKSchott

@Monchi: As mentioned here, snowpack's babel plugin is getting complicated and need to be tested.

This ticket should probably start by investigating this tool from the Babel team for testing Babel plugins: https://github.com/babel-utils/babel-plugin-tester

Most helpful comment

@crra ah, that's a great point, we use --include on the post-babel built directory as well for Pika.dev. We should probably ignore/strip everything in the query param when we do import scanning.

PR submitted: https://github.com/pikapkg/snowpack/pull/161

All 6 comments

@Monchi any interest in tackling this?

@FredKSchott Sure, assign me please :)

Thank you! Let me know if I can help in any way

I’ll work on this next Sunday

Hello @Monchi,

you may want to take a look at the configuration option: addVersion and the integration into the showpack-bin. If I configure it like:

[
  "snowpack/assets/babel-plugin.js",
  { "optionalExtensions": true, "addVersion": true }
],

snowpack-bin is not longer capable of resolving the dependencies.

snowpack --include "dist/**/*.js" --dest dist/web_modules

â ¼ snowpack installing... preact.js?v=10.2.1
[0] ✖ Cannot find module 'preact.js?v=10.2.1'

@crra ah, that's a great point, we use --include on the post-babel built directory as well for Pika.dev. We should probably ignore/strip everything in the query param when we do import scanning.

PR submitted: https://github.com/pikapkg/snowpack/pull/161

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FredKSchott picture FredKSchott  Â·  4Comments

FredKSchott picture FredKSchott  Â·  6Comments

FredKSchott picture FredKSchott  Â·  6Comments

FredKSchott picture FredKSchott  Â·  5Comments

FredKSchott picture FredKSchott  Â·  6Comments