Parcel: Asset development help needed

Created on 29 Dec 2017  路  3Comments  路  Source: parcel-bundler/parcel

Hello,

I'm trying to develop Gopherjs asset for .go files: gopherjs_parcel_asset, using Svelte plugin as prototype. But somehow it does not work.

Steps to reproduce:

git clone https://github.com/algebraic-brain/gopherjs_parcel_asset
cd gopherjs_parcel_asset/example
npm i .. -s
parcel index.html

Then we find that the ./go/hello.go file was included into index.html with no changes.

What I do wrong? Please help me.

Question

All 3 comments

at first glance, it looks like you're calling this.async() in parse which isn't a thing in parcel. https://github.com/algebraic-brain/gopherjs_parcel_asset/blob/master/GopherJSAsset.js#L10

You could return a promise:

return new Promise((resolve, reject) =>
   // do some stuff
  resolve();
});

Thank you Devon. I'm going to rewrite the code of GopherJSAsset totally, but it seems that Parcel does not see my asset at all. Would it help if i give my asset name starting with parcel-plugin- ?

Yes, that naming convention is currently required for parcel to detect your plugins.

Was this page helpful?
0 / 5 - 0 ratings